diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 9b716abf1..8900ae189 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,21 @@ -speakeasyVersion: 1.636.3 +speakeasyVersion: 1.686.0 sources: Outpost API: sourceNamespace: outpost-api - sourceRevisionDigest: sha256:abcb227d706ddbbb55ab9a423da413260c4d83c247616a9f6067890ff4bfa997 - sourceBlobDigest: sha256:b8f43e14862cadf618bc568c76cec68ed15da6c4c7fec0541edd4671a3b26815 + sourceRevisionDigest: sha256:8941d1967366536a7f0a5ffcdc01778a28f4b8b924742cd71187bbc7b9d3c1bd + sourceBlobDigest: sha256:bc4c78bf0f74da9cbc25c15d9c2fe8ccde94fabf447bb8de28307556efaa7d7d tags: - latest + - speakeasy-sdk-regen-1768556640 - 0.0.1 targets: outpost-go: source: Outpost API sourceNamespace: outpost-api - sourceRevisionDigest: sha256:4042dbef541e06289b580460ccfb39d8f444c852e134de2245b13e1ffd43dcf3 - sourceBlobDigest: sha256:3859f29c380e176f9382eb969cefbb9c8701875d4837ee8a9549b78bf92eebc6 + sourceRevisionDigest: sha256:8941d1967366536a7f0a5ffcdc01778a28f4b8b924742cd71187bbc7b9d3c1bd + sourceBlobDigest: sha256:bc4c78bf0f74da9cbc25c15d9c2fe8ccde94fabf447bb8de28307556efaa7d7d codeSamplesNamespace: outpost-api-go-code-samples - codeSamplesRevisionDigest: sha256:0e3fa3204f6f516dd30a924b7a1c07749873126109ccc30817795cd02c9854d7 + codeSamplesRevisionDigest: sha256:77daa72d768a7e2d49a8d9f4ddc6ad8b999fa186832b66c268e126ddcd7a40c6 outpost-python: source: Outpost API sourceNamespace: outpost-api diff --git a/sdks/outpost-go/.gitignore b/sdks/outpost-go/.gitignore index a1e438271..e9661d16e 100644 --- a/sdks/outpost-go/.gitignore +++ b/sdks/outpost-go/.gitignore @@ -1,3 +1,5 @@ +.env +.env.local # .gitignore .DS_Store **/.speakeasy/temp/ diff --git a/sdks/outpost-go/.speakeasy/gen.lock b/sdks/outpost-go/.speakeasy/gen.lock index 2ac3d6f91..1e2d9bf4c 100644 --- a/sdks/outpost-go/.speakeasy/gen.lock +++ b/sdks/outpost-go/.speakeasy/gen.lock @@ -1,322 +1,1303 @@ lockVersion: 2.0.0 id: f0627709-5a00-43ac-8678-ca716d6f379c management: - docChecksum: b861adfcca926bafba8ea408261b6b73 + docChecksum: 69b1d2171bde78e84ab6cfa4914c6bf9 docVersion: 0.0.1 - speakeasyVersion: 1.608.0 - generationVersion: 2.691.6 - releaseVersion: 0.4.0 - configChecksum: 43464e6037bc44205e4d81ff9337663b + speakeasyVersion: 1.686.0 + generationVersion: 2.796.1 + releaseVersion: 0.5.0 + configChecksum: 4cd14feb7870b13553464297b65ca701 repoURL: https://github.com/hookdeck/outpost.git repoSubDirectory: sdks/outpost-go installationURL: https://github.com/hookdeck/outpost/sdks/outpost-go +persistentEdits: + generation_id: 8620d4f8-fde0-4516-9f97-a4788bf57870 + pristine_commit_hash: 4297383af2e1eafc06a91ad9104a77dfde8d9a5e + pristine_tree_hash: 07e403e65a91efdec4264b062e7961869eddab37 features: go: additionalDependencies: 0.1.0 additionalProperties: 0.1.2 constsAndDefaults: 0.1.12 - core: 3.9.6 + core: 3.13.10 defaultEnabledRetries: 0.2.0 envVarSecurityUsage: 0.3.2 flattening: 2.81.1 - globalSecurity: 2.82.11 + globalSecurity: 2.82.12 globalSecurityCallbacks: 0.1.0 - globalServerURLs: 2.82.3 + globalServerURLs: 2.83.0 globals: 2.82.2 intellisenseMarkdownSupport: 0.1.0 nameOverrides: 2.81.2 - nullables: 0.1.1 + nullables: 0.2.1 responseFormat: 0.1.2 retries: 2.84.2 - sdkHooks: 0.2.0 - unions: 2.85.14 -generatedFiles: - - .gitattributes - - /models/apierrors/badrequesterror.go - - /models/apierrors/internalservererror.go - - /models/apierrors/notfounderror.go - - /models/apierrors/ratelimitederror.go - - /models/apierrors/timeouterror.go - - /models/apierrors/unauthorizederror.go - - /models/components/awskinesisconfig.go - - /models/components/awskinesiscredentials.go - - /models/components/awss3config.go - - /models/components/awss3credentials.go - - /models/components/awssqsconfig.go - - /models/components/awssqscredentials.go - - /models/components/azureservicebusconfig.go - - /models/components/azureservicebuscredentials.go - - /models/components/deliveryattempt.go - - /models/components/destination.go - - /models/components/destinationawskinesis.go - - /models/components/destinationawss3.go - - /models/components/destinationawssqs.go - - /models/components/destinationazureservicebus.go - - /models/components/destinationcreate.go - - /models/components/destinationcreateawskinesis.go - - /models/components/destinationcreateawss3.go - - /models/components/destinationcreateawssqs.go - - /models/components/destinationcreateazureservicebus.go - - /models/components/destinationcreatehookdeck.go - - /models/components/destinationcreaterabbitmq.go - - /models/components/destinationcreatewebhook.go - - /models/components/destinationhookdeck.go - - /models/components/destinationrabbitmq.go - - /models/components/destinationschemafield.go - - /models/components/destinationtypeschema.go - - /models/components/destinationupdate.go - - /models/components/destinationupdateawskinesis.go - - /models/components/destinationupdateawss3.go - - /models/components/destinationupdateawssqs.go - - /models/components/destinationupdatehookdeck.go - - /models/components/destinationupdaterabbitmq.go - - /models/components/destinationupdatewebhook.go - - /models/components/destinationwebhook.go - - /models/components/event.go - - /models/components/hookdeckcredentials.go - - /models/components/httpmetadata.go - - /models/components/portalredirect.go - - /models/components/publishrequest.go - - /models/components/publishresponse.go - - /models/components/rabbitmqconfig.go - - /models/components/rabbitmqcredentials.go - - /models/components/security.go - - /models/components/successresponse.go - - /models/components/tenant.go - - /models/components/tenanttoken.go - - /models/components/topics.go - - /models/components/webhookconfig.go - - /models/components/webhookcredentials.go - - /models/components/webhookcredentialsupdate.go - - /models/operations/createtenantdestination.go - - /models/operations/deletetenant.go - - /models/operations/deletetenantdestination.go - - /models/operations/disabletenantdestination.go - - /models/operations/enabletenantdestination.go - - /models/operations/getdestinationtypeschema.go - - /models/operations/gettenant.go - - /models/operations/gettenantdestination.go - - /models/operations/gettenantdestinationtypeschema.go - - /models/operations/gettenantevent.go - - /models/operations/gettenanteventbydestination.go - - /models/operations/gettenantportalurl.go - - /models/operations/gettenanttoken.go - - /models/operations/healthcheck.go - - /models/operations/listdestinationtypeschemasjwt.go - - /models/operations/listtenantdestinations.go - - /models/operations/listtenantdestinationtypeschemas.go - - /models/operations/listtenanteventdeliveries.go - - /models/operations/listtenantevents.go - - /models/operations/listtenanteventsbydestination.go - - /models/operations/listtenanttopics.go - - /models/operations/listtopics.go - - /models/operations/publishevent.go - - /models/operations/retrytenantevent.go - - /models/operations/updatetenantdestination.go - - /models/operations/upserttenant.go - - USAGE.md - - destinations.go - - docs/models/apierrors/badrequesterror.md - - docs/models/apierrors/internalservererror.md - - docs/models/apierrors/notfounderror.md - - docs/models/apierrors/ratelimitederror.md - - docs/models/apierrors/timeouterror.md - - docs/models/apierrors/unauthorizederror.md - - docs/models/components/awskinesisconfig.md - - docs/models/components/awskinesiscredentials.md - - docs/models/components/awss3config.md - - docs/models/components/awss3credentials.md - - docs/models/components/awssqsconfig.md - - docs/models/components/awssqscredentials.md - - docs/models/components/azureservicebusconfig.md - - docs/models/components/azureservicebuscredentials.md - - docs/models/components/deliveryattempt.md - - docs/models/components/destination.md - - docs/models/components/destinationawskinesis.md - - docs/models/components/destinationawskinesistype.md - - docs/models/components/destinationawss3.md - - docs/models/components/destinationawss3type.md - - docs/models/components/destinationawssqs.md - - docs/models/components/destinationawssqstype.md - - docs/models/components/destinationazureservicebus.md - - docs/models/components/destinationazureservicebustype.md - - docs/models/components/destinationcreate.md - - docs/models/components/destinationcreateawskinesis.md - - docs/models/components/destinationcreateawskinesistype.md - - docs/models/components/destinationcreateawss3.md - - docs/models/components/destinationcreateawss3type.md - - docs/models/components/destinationcreateawssqs.md - - docs/models/components/destinationcreateawssqstype.md - - docs/models/components/destinationcreateazureservicebus.md - - docs/models/components/destinationcreateazureservicebustype.md - - docs/models/components/destinationcreatehookdeck.md - - docs/models/components/destinationcreatehookdecktype.md - - docs/models/components/destinationcreaterabbitmq.md - - docs/models/components/destinationcreaterabbitmqtype.md - - docs/models/components/destinationcreatewebhook.md - - docs/models/components/destinationcreatewebhooktype.md - - docs/models/components/destinationhookdeck.md - - docs/models/components/destinationhookdecktype.md - - docs/models/components/destinationrabbitmq.md - - docs/models/components/destinationrabbitmqtype.md - - docs/models/components/destinationschemafield.md - - docs/models/components/destinationschemafieldtype.md - - docs/models/components/destinationtypeschema.md - - docs/models/components/destinationupdate.md - - docs/models/components/destinationupdateawskinesis.md - - docs/models/components/destinationupdateawss3.md - - docs/models/components/destinationupdateawssqs.md - - docs/models/components/destinationupdatehookdeck.md - - docs/models/components/destinationupdaterabbitmq.md - - docs/models/components/destinationupdatewebhook.md - - docs/models/components/destinationwebhook.md - - docs/models/components/destinationwebhooktype.md - - docs/models/components/event.md - - docs/models/components/hookdeckcredentials.md - - docs/models/components/httpmetadata.md - - docs/models/components/portalredirect.md - - docs/models/components/publishrequest.md - - docs/models/components/publishresponse.md - - docs/models/components/rabbitmqconfig.md - - docs/models/components/rabbitmqcredentials.md - - docs/models/components/security.md - - docs/models/components/status.md - - docs/models/components/successresponse.md - - docs/models/components/tenant.md - - docs/models/components/tenanttoken.md - - docs/models/components/tls.md - - docs/models/components/topics.md - - docs/models/components/topicsenum.md - - docs/models/components/webhookconfig.md - - docs/models/components/webhookcredentials.md - - docs/models/components/webhookcredentialsupdate.md - - docs/models/operations/createtenantdestinationglobals.md - - docs/models/operations/createtenantdestinationrequest.md - - docs/models/operations/createtenantdestinationresponse.md - - docs/models/operations/deletetenantdestinationglobals.md - - docs/models/operations/deletetenantdestinationrequest.md - - docs/models/operations/deletetenantdestinationresponse.md - - docs/models/operations/deletetenantglobals.md - - docs/models/operations/deletetenantrequest.md - - docs/models/operations/deletetenantresponse.md - - docs/models/operations/destinationid.md - - docs/models/operations/disabletenantdestinationglobals.md - - docs/models/operations/disabletenantdestinationrequest.md - - docs/models/operations/disabletenantdestinationresponse.md - - docs/models/operations/enabletenantdestinationglobals.md - - docs/models/operations/enabletenantdestinationrequest.md - - docs/models/operations/enabletenantdestinationresponse.md - - docs/models/operations/getdestinationtypeschemarequest.md - - docs/models/operations/getdestinationtypeschemaresponse.md - - docs/models/operations/getdestinationtypeschematype.md - - docs/models/operations/gettenantdestinationglobals.md - - docs/models/operations/gettenantdestinationrequest.md - - docs/models/operations/gettenantdestinationresponse.md - - docs/models/operations/gettenantdestinationtypeschemaglobals.md - - docs/models/operations/gettenantdestinationtypeschemarequest.md - - docs/models/operations/gettenantdestinationtypeschemaresponse.md - - docs/models/operations/gettenantdestinationtypeschematype.md - - docs/models/operations/gettenanteventbydestinationglobals.md - - docs/models/operations/gettenanteventbydestinationrequest.md - - docs/models/operations/gettenanteventbydestinationresponse.md - - docs/models/operations/gettenanteventglobals.md - - docs/models/operations/gettenanteventrequest.md - - docs/models/operations/gettenanteventresponse.md - - docs/models/operations/gettenantglobals.md - - docs/models/operations/gettenantportalurlglobals.md - - docs/models/operations/gettenantportalurlrequest.md - - docs/models/operations/gettenantportalurlresponse.md - - docs/models/operations/gettenantrequest.md - - docs/models/operations/gettenantresponse.md - - docs/models/operations/gettenanttokenglobals.md - - docs/models/operations/gettenanttokenrequest.md - - docs/models/operations/gettenanttokenresponse.md - - docs/models/operations/healthcheckresponse.md - - docs/models/operations/listdestinationtypeschemasjwtresponse.md - - docs/models/operations/listtenantdestinationsglobals.md - - docs/models/operations/listtenantdestinationsrequest.md - - docs/models/operations/listtenantdestinationsresponse.md - - docs/models/operations/listtenantdestinationstypeenum1.md - - docs/models/operations/listtenantdestinationstypeenum2.md - - docs/models/operations/listtenantdestinationtypeschemasglobals.md - - docs/models/operations/listtenantdestinationtypeschemasrequest.md - - docs/models/operations/listtenantdestinationtypeschemasresponse.md - - docs/models/operations/listtenanteventdeliveriesglobals.md - - docs/models/operations/listtenanteventdeliveriesrequest.md - - docs/models/operations/listtenanteventdeliveriesresponse.md - - docs/models/operations/listtenanteventsbydestinationglobals.md - - docs/models/operations/listtenanteventsbydestinationrequest.md - - docs/models/operations/listtenanteventsbydestinationresponse.md - - docs/models/operations/listtenanteventsbydestinationresponsebody.md - - docs/models/operations/listtenanteventsbydestinationstatus.md - - docs/models/operations/listtenanteventsglobals.md - - docs/models/operations/listtenanteventsrequest.md - - docs/models/operations/listtenanteventsresponse.md - - docs/models/operations/listtenanteventsresponsebody.md - - docs/models/operations/listtenanteventsstatus.md - - docs/models/operations/listtenanttopicsglobals.md - - docs/models/operations/listtenanttopicsrequest.md - - docs/models/operations/listtenanttopicsresponse.md - - docs/models/operations/listtopicsresponse.md - - docs/models/operations/option.md - - docs/models/operations/publisheventresponse.md - - docs/models/operations/retrytenanteventglobals.md - - docs/models/operations/retrytenanteventrequest.md - - docs/models/operations/retrytenanteventresponse.md - - docs/models/operations/theme.md - - docs/models/operations/topics.md - - docs/models/operations/type.md - - docs/models/operations/updatetenantdestinationglobals.md - - docs/models/operations/updatetenantdestinationrequest.md - - docs/models/operations/updatetenantdestinationresponse.md - - docs/models/operations/updatetenantdestinationresponsebody.md - - docs/models/operations/upserttenantglobals.md - - docs/models/operations/upserttenantrequest.md - - docs/models/operations/upserttenantresponse.md - - docs/sdks/destinations/README.md - - docs/sdks/events/README.md - - docs/sdks/health/README.md - - docs/sdks/outpost/README.md - - docs/sdks/publish/README.md - - docs/sdks/schemas/README.md - - docs/sdks/tenants/README.md - - docs/sdks/topics/README.md - - events.go - - go.mod - - health.go - - internal/config/sdkconfiguration.go - - internal/globals/globals.go - - internal/hooks/hooks.go - - internal/utils/contenttype.go - - internal/utils/env.go - - internal/utils/form.go - - internal/utils/headers.go - - internal/utils/json.go - - internal/utils/pathparams.go - - internal/utils/queryparams.go - - internal/utils/requestbody.go - - internal/utils/retries.go - - internal/utils/security.go - - internal/utils/utils.go - - models/apierrors/apierror.go - - models/operations/options.go - - outpost.go - - publish.go - - retry/config.go - - schemas.go - - tenants.go - - topics.go - - types/bigint.go - - types/date.go - - types/datetime.go - - types/decimal.go - - types/pointers.go + sdkHooks: 0.3.0 + unions: 2.87.2 +trackedFiles: + .gitattributes: + id: 24139dae6567 + last_write_checksum: sha1:84b0115789fc3ea52e31df701d8a27f76077e29f + pristine_git_object: e6a994416d0f527912d2d272e2583458f4fc9bcb + USAGE.md: + id: 3aed33ce6e6f + last_write_checksum: sha1:b1f4fd1c06315a25e49c82958dbdaae7e0415fd1 + pristine_git_object: 302b1c4952b4902140fcd2a6b900b887733b3255 + destinations.go: + id: c850727f8555 + last_write_checksum: sha1:f3b340ce69d8e6b2b34bffb0bab0286147917a38 + pristine_git_object: 23250994e08280b886fbdf48fa2cfecb2779ccbb + docs/models/apierrors/badrequesterror.md: + id: fdf908c95e30 + last_write_checksum: sha1:362a01f53f1ba6bac8d882037dba09d2e5d62101 + pristine_git_object: d8d170516d1f43504aa5803f620e52181f35b4db + docs/models/apierrors/internalservererror.md: + id: 7a7cb4efafe1 + last_write_checksum: sha1:33e3ea91cdd2c0d2496336eca3904c919c2beaeb + pristine_git_object: 7c02f93b9027b41cfead6324176c24b189898765 + docs/models/apierrors/listtenantsbadrequesterror.md: + id: bc19c5924e0b + last_write_checksum: sha1:db8882aec3d7df24c700bda6b08887702bd5cc3b + pristine_git_object: 1cf091d3ebd6602b93d6c9b6a4b25865ba049bfb + docs/models/apierrors/notfounderror.md: + id: a9227f3be4de + last_write_checksum: sha1:580d893f8b049005869db6d02fd001df0b736fb0 + pristine_git_object: 2d4800dc3efa4d9bfd679e62587613f5e836fd10 + docs/models/apierrors/notimplementederror.md: + id: b34831256c44 + last_write_checksum: sha1:113191fcb09828c39f7d483418180c269dd59e99 + pristine_git_object: 9f5d1df8fcc9c5782c6f340570f58717e27609e1 + docs/models/apierrors/ratelimitederror.md: + id: acffc0addc25 + last_write_checksum: sha1:9bf0799f09fd90784eadb926cee239bc8cad1bac + pristine_git_object: ba1212522ecead4c6fd4ff95d58fcdf8c7baf78d + docs/models/apierrors/timeouterror.md: + id: "882443261215" + last_write_checksum: sha1:75439face10b78893dccc3c43cb180b4aefc4d6f + pristine_git_object: d6328241c04810fb0d0c939619e17fb12b94a11b + docs/models/apierrors/unauthorizederror.md: + id: 8177276c47f6 + last_write_checksum: sha1:8ea8a428be0a9903760f7789bdf42507abdf6356 + pristine_git_object: 8bf81c350d071860d4f5041552b3579b61fcb706 + docs/models/components/awskinesisconfig.md: + id: e1381238f2b5 + last_write_checksum: sha1:cf99b0464ca9ab356074db22911f719dc184bbd3 + pristine_git_object: f9bc4733239b6caa0c3dd70b10a28930e82d1fa5 + docs/models/components/awskinesiscredentials.md: + id: 3ab813efa2d5 + last_write_checksum: sha1:470737ea8033be3ae291cba589af2e96a3735a48 + pristine_git_object: 3f4856f8b9733600c18bf0bac693b120f7304d13 + docs/models/components/awss3config.md: + id: 14eb9dea39a9 + last_write_checksum: sha1:a569eba2e1a689cafa0bd5964b3dd1d7849d8e0e + pristine_git_object: 5296ae614d0d9d8249f3f85532955818b57aa14c + docs/models/components/awss3credentials.md: + id: b95017cfda5f + last_write_checksum: sha1:6ab1ba737ecdaca80b22ce6869b9f98206a5a594 + pristine_git_object: db0ef61e5228cdd9b5cc8efffea68cfa32f87bf0 + docs/models/components/awssqsconfig.md: + id: ea7025d155f5 + last_write_checksum: sha1:5be741961c7b3b5039ccd81f2347794cd3f25b6c + pristine_git_object: 6b2fb0ac471089c285cb58ea2beff0948b3771dd + docs/models/components/awssqscredentials.md: + id: d0c7fdf810bb + last_write_checksum: sha1:c6f35a38f1185636547a9f0921c218b8cacce93e + pristine_git_object: d53059fcbbefc354559d03f156113b45fbd9ea4d + docs/models/components/azureservicebusconfig.md: + id: b59836904ced + last_write_checksum: sha1:d7d80ae36e63f2d4857317bcc53d226c750f3a6d + pristine_git_object: 6f4da0b89ed91666a8da397af8625d2859d2c464 + docs/models/components/azureservicebuscredentials.md: + id: 321716ccc7a5 + last_write_checksum: sha1:fe53a51bb6665de557ad18f4a1fbe4c1f5a39fea + pristine_git_object: d5cf2705b49d23943d92561ef29d85b9b0b89eeb + docs/models/components/deliveryattempt.md: + id: f0e8e5c4ee68 + last_write_checksum: sha1:d4b635cd180ba1a099953bb0aa80ef42020391df + pristine_git_object: 84f513984aa8c414df2369d0d9923068c338c8c4 + docs/models/components/deliveryattemptstatus.md: + id: 9ead5c076a36 + last_write_checksum: sha1:fa3757c24bae72f7a1578bac1a30a8be48fee381 + pristine_git_object: 0a78373b1faa8000f54fb9e2fd26b8d647aa7de3 + docs/models/components/destination.md: + id: e8bd99c21e69 + last_write_checksum: sha1:a3b66a88fb49119a1d423bb0237c96eff2b48770 + pristine_git_object: 563db6125326f135fcd0c760ce8da81214caa6b4 + docs/models/components/destinationawskinesis.md: + id: b14a0a005618 + last_write_checksum: sha1:0ec14379f9c662a32435c54f41eeeb3cbe9d91e8 + pristine_git_object: 52a279bd76c86c6358a1eb62f40686e18b9e8866 + docs/models/components/destinationawskinesistype.md: + id: bcee015e58a9 + last_write_checksum: sha1:4ea7497e9847a7efcd19ba9c265fd99a82f2c6ff + pristine_git_object: 10a4f517a5eff74f3ad54314a9fea9c409ea708f + docs/models/components/destinationawss3.md: + id: 906ec923f423 + last_write_checksum: sha1:d20861a9b4647d2b9d1eeaa5a031b11b025b8043 + pristine_git_object: dc74159f14d7d71eca9053886e52cf438cd3e32d + docs/models/components/destinationawss3type.md: + id: a0a8c1c43c1e + last_write_checksum: sha1:6f4ddfec75461223f31048d447f512e73ef4adc5 + pristine_git_object: 361a3107f49f474cd6f53958908b0848912d5216 + docs/models/components/destinationawssqs.md: + id: 3a958a8ebec9 + last_write_checksum: sha1:67b0030438ac439163ee9938ba87abe05cdf6351 + pristine_git_object: 238f02004aa50f359a964f343e81c15c9e1743c2 + docs/models/components/destinationawssqstype.md: + id: 26c8eec5f1a2 + last_write_checksum: sha1:6ba8f90fac3ae8bfe402b4801e49222a7e029824 + pristine_git_object: cb2af03ed0fd25f7f792c1e8f981a9f5b5e9484d + docs/models/components/destinationazureservicebus.md: + id: fcf6d1e4ce40 + last_write_checksum: sha1:8d01407e98f05605102b45d5b2c94d7a051a283c + pristine_git_object: 55e4288658c3a724a24f33d4b8e296e5ab97f1dc + docs/models/components/destinationazureservicebustype.md: + id: 293590e753b9 + last_write_checksum: sha1:5ddb405dca7f5bdd9be01e785582023d0a9e1a29 + pristine_git_object: 348518c8fe133bab5d55cc6883a72bd066c42530 + docs/models/components/destinationcreate.md: + id: d6b44cacc867 + last_write_checksum: sha1:a7867d83bf834cfa53fd2c989516b5c607deb10b + pristine_git_object: c5c1f83e55c85cd3171795491c77dc9b047ff36b + docs/models/components/destinationcreateawskinesis.md: + id: 5593f1bd5e1a + last_write_checksum: sha1:0a88b344f56695ec2efdafa0592097f4343a6c40 + pristine_git_object: 2d16282ad042ae6f0f57d61ea016ac3454f1299d + docs/models/components/destinationcreateawskinesistype.md: + id: 6956680339a0 + last_write_checksum: sha1:426af4532e944782c5af4d04e681ed283897f6b5 + pristine_git_object: 0651fa4c92bd6483a650f5d7e2225e4f557ecff5 + docs/models/components/destinationcreateawss3.md: + id: af91634b61a0 + last_write_checksum: sha1:4106453a4f6f5fca6c092cdd01b0fc07e1396460 + pristine_git_object: fa28da887cb2d7b3b8d0451a4d42bb7d97556dbb + docs/models/components/destinationcreateawss3type.md: + id: 6877bf7e23ec + last_write_checksum: sha1:3755015cae414085e822cc9f4e0dc0d1b5e0b3a7 + pristine_git_object: 9d57a0e77de012df1fceb890c43b3ae69133b658 + docs/models/components/destinationcreateawssqs.md: + id: c6b726f0ec14 + last_write_checksum: sha1:214873ee1efc1a61e4a84c4df9373cc092ac62b8 + pristine_git_object: 8ab1cf69251d9282b03c984379939b1b9dd6bed6 + docs/models/components/destinationcreateawssqstype.md: + id: 1ef234381d5e + last_write_checksum: sha1:11d1bd44fbb8febebb421117c244932d8d4934f4 + pristine_git_object: 058808784e139360740b0881f44e8be7ee1b481b + docs/models/components/destinationcreateazureservicebus.md: + id: 89472b979d07 + last_write_checksum: sha1:66930bfb87fbc9d4372e4fb8364441a766c748b7 + pristine_git_object: 6a43e434e6846de39d4f618c7377abd4c09c94b0 + docs/models/components/destinationcreateazureservicebustype.md: + id: 7bcec8499967 + last_write_checksum: sha1:8b992e9422ac8f9fd532221e58644fc6b833d1b3 + pristine_git_object: 8ea10e2a417d6a02d290721b09d4be530e955a06 + docs/models/components/destinationcreategcppubsub.md: + id: 83e1ebef3406 + last_write_checksum: sha1:4242524dbb71c9cef0a47faa3fa22c32d57203fb + pristine_git_object: 21347fb9b9080f55d735b5f20e115e4da2d47def + docs/models/components/destinationcreategcppubsubtype.md: + id: dc2f412568a7 + last_write_checksum: sha1:e1f8657640d9f78eab73bae5e67a2dc6b5c9bc99 + pristine_git_object: 409ddd9fbb717713692cc6879188029c8edeaa7a + docs/models/components/destinationcreatehookdeck.md: + id: a06f19b079ed + last_write_checksum: sha1:7a3e430c0dfbf390c8dcb671a50f9f4a820ff477 + pristine_git_object: d0d35b2b64b0d1c3eb4e82ed4775d71dbd4d3f23 + docs/models/components/destinationcreatehookdecktype.md: + id: 7633062252b9 + last_write_checksum: sha1:7ce3955d41f88275d77ed89e4c337316f7dfd564 + pristine_git_object: e1333eb739003ff236f05a9981e7acb4717bb32b + docs/models/components/destinationcreaterabbitmq.md: + id: 3f95bd0221e2 + last_write_checksum: sha1:c85d532760c703e794c8dda7d4aa22e4e9aee703 + pristine_git_object: 438cf45c3eb70c80ff4f4c6a9b891769e8149e06 + docs/models/components/destinationcreaterabbitmqtype.md: + id: 71cf19ccfc8b + last_write_checksum: sha1:7bbc6c3bac4a401d141520ee86e5cf396a1bbd57 + pristine_git_object: 7d648794a4794e7001135604934a8013da5c6c0e + docs/models/components/destinationcreatewebhook.md: + id: 92e4ccbf4461 + last_write_checksum: sha1:ef55d78e5207d5fafc73031497195bf918618849 + pristine_git_object: 48521fca42f3036cc1dad98a2d7fbad24354ff70 + docs/models/components/destinationcreatewebhooktype.md: + id: b112cbdd9f49 + last_write_checksum: sha1:81cd04dc4a147b68b154ffc7c6a469a0bba4f2cf + pristine_git_object: 5f2efc0743751373aa3ab0121c16db3ed398e3f8 + docs/models/components/destinationgcppubsub.md: + id: 557a06720b9c + last_write_checksum: sha1:9fc07a6dd9b5c01310f6ae60182e484ad7c8093b + pristine_git_object: 766476405aeaeeec7f588325aa8ea650e7dd96ca + docs/models/components/destinationgcppubsubtype.md: + id: 534d34c1b5da + last_write_checksum: sha1:e87027150c62173c57e6009545bd8399e18aa7f4 + pristine_git_object: 1ca603890057e83c6d28279579114186f17649f0 + docs/models/components/destinationhookdeck.md: + id: 96d7701b7615 + last_write_checksum: sha1:1c8648ade4f857b78dddad01b4c1834cdae2fc93 + pristine_git_object: 8b217e0e69d7a96e28ca21f128b10a7582332942 + docs/models/components/destinationhookdecktype.md: + id: 20b93e4b32a3 + last_write_checksum: sha1:f8c90aa332d7547ac655a39749e26f780bb95edf + pristine_git_object: 25b8b28dba34b263205c4f328deb622dfff7d6e4 + docs/models/components/destinationrabbitmq.md: + id: 30c699fde40a + last_write_checksum: sha1:c2cb95292ba8fc3395d71e82596d144477e4c1a5 + pristine_git_object: 5bad05f05a591bbaab2c52254410e120a35b6a8d + docs/models/components/destinationrabbitmqtype.md: + id: 36f7e64c4fe6 + last_write_checksum: sha1:ffb93b1d9161ae39138b780b286fa5c90fcbbcfb + pristine_git_object: b18d3d751716bceb40f0823a551b9c8d45573b3e + docs/models/components/destinationschemafield.md: + id: 4d759c96e266 + last_write_checksum: sha1:5f8ead0c5e997500934e4eb9f0f8ecac0903d7e8 + pristine_git_object: bd2112c0165b874677c47a4e570440976989bbb7 + docs/models/components/destinationschemafieldtype.md: + id: a3bc014869f3 + last_write_checksum: sha1:23e56caa0e2857f208226cc9458dc1bf05ee5bf1 + pristine_git_object: cab45197856fe6875d6643b6d311715fd6204a06 + docs/models/components/destinationtype.md: + id: 72fecd6c9840 + last_write_checksum: sha1:715267b9b18ed1b2c85b6470265cb059a26d6a57 + pristine_git_object: 1cdfbc8540c6f757029165cab5812fb237e45bc8 + docs/models/components/destinationtypeschema.md: + id: f83242f4d690 + last_write_checksum: sha1:fe308b3f042e556e6c1b74e4c57f549dffe4d131 + pristine_git_object: 7867f978cd9ac4190393e847d58c2fc8aef7866a + docs/models/components/destinationupdate.md: + id: b3a23ab3e68a + last_write_checksum: sha1:4185a8f993da1c89ee68dbc6687fa2f9ef5eb80f + pristine_git_object: 63c548e066f28ad6f4b79a9cbdb0bed27cda1ed4 + docs/models/components/destinationupdateawskinesis.md: + id: e0a4842ef74c + last_write_checksum: sha1:4779742b95f210f4e63cc3369ca09eebc711f862 + pristine_git_object: d7e991abd37739480fe3d6a1071b1b21fef09f4d + docs/models/components/destinationupdateawss3.md: + id: c250ff90df94 + last_write_checksum: sha1:64362484721e6988efce2cd5c386a0590819e2df + pristine_git_object: dc0e930b41820d57dc00d1ee5ffe9cfd1c8567e3 + docs/models/components/destinationupdateawssqs.md: + id: e2401ded4e44 + last_write_checksum: sha1:1f31c89c4e893a1197b4a06222c9df18f8fc2628 + pristine_git_object: c46ee2c3d4bd0f3c97e5d784e215cfc07c467dec + docs/models/components/destinationupdateazureservicebus.md: + id: f230709db383 + last_write_checksum: sha1:8e8dcfdd697e3fb11a2caf6b75b6bcac88004260 + pristine_git_object: 67abfea1c7f211b3e2e6b7da08e146c4755e0600 + docs/models/components/destinationupdategcppubsub.md: + id: dfb954a0431a + last_write_checksum: sha1:1981ee12e1614996aaffe22e5d94c5559ec4d5ba + pristine_git_object: abb0ff527fa4fc18c9439149385886d87764711f + docs/models/components/destinationupdatehookdeck.md: + id: 2d0fe3ebe94f + last_write_checksum: sha1:528fa851215b86b4dbaf6402bb56845f0e090a6c + pristine_git_object: 318ddc5c8a5d250ecf071ec379f9e370bf716222 + docs/models/components/destinationupdaterabbitmq.md: + id: 75ae8e40dfd5 + last_write_checksum: sha1:d67fd894c938ff3be009f37105b3bc630941928c + pristine_git_object: 7caa568ed597431601ba5f16460eeba2dd49aa90 + docs/models/components/destinationupdatewebhook.md: + id: 86013f6d41fd + last_write_checksum: sha1:46776398ae0cb49e84a2cd93b3ff77b1283a28ea + pristine_git_object: 255b90891f6557db6f3dea774c6a634df5f05635 + docs/models/components/destinationwebhook.md: + id: 1b6ca867dbc9 + last_write_checksum: sha1:85517e972afa42753b81cecfeccdc1bf1043b5c2 + pristine_git_object: 96dc5048db6719a3c71208240b8d13affe7ca6bd + docs/models/components/destinationwebhooktype.md: + id: 9af3df11d0a9 + last_write_checksum: sha1:b7330e2f9ed70909e3eb2c494b9f892a1ffe7407 + pristine_git_object: a53478e22db0cc9cbdaf54bf798afe0badbd2a57 + docs/models/components/event.md: + id: 0593e0f6a673 + last_write_checksum: sha1:1a1e4f5be1ff22bf69dac9ef290233f2102c9fe1 + pristine_git_object: cab472aa777c66360f5d1ab1f7fba604a2b60488 + docs/models/components/eventstatus.md: + id: ee6dbe7c20c3 + last_write_checksum: sha1:4c870822acbe61d997ee25ba2b83441e0d4a56bd + pristine_git_object: e88072caff7b2a2a2f5cf5531a80adddf89e7a15 + docs/models/components/gcppubsubconfig.md: + id: 77b79c449da7 + last_write_checksum: sha1:5aa83eee176747bdf0304b093f02d4ff4a94dbda + pristine_git_object: 3455e10f9b719d38b4022901c75a09ec75e27c89 + docs/models/components/gcppubsubcredentials.md: + id: 5d3ac2925858 + last_write_checksum: sha1:e31d44aa42fb438e50691c4d9bef5f2e7925175d + pristine_git_object: e5a2e9e72ed5cf0d007039fc462c6dde7acf1b0b + docs/models/components/hookdeckcredentials.md: + id: a80eb3867695 + last_write_checksum: sha1:a896df64075553c9d09a540af8936a05d3e778e5 + pristine_git_object: 62ddadf03a916b25435ededfe1c03f1b75923059 + docs/models/components/httpmetadata.md: + id: 728948c70168 + last_write_checksum: sha1:7c40945dac218ce5e5e11e7c907d27a3ea14c417 + pristine_git_object: df1fdd59f3c85e4ba70573ff7954b12ac1d33d08 + docs/models/components/portalredirect.md: + id: bd1e51e1707f + last_write_checksum: sha1:2b96fcbe0003d74a768dac204446b46d5cd13dd2 + pristine_git_object: 768eb5c98107c22d273f285fdbed327ca8a2e878 + docs/models/components/publishrequest.md: + id: 2a23e49f8f3f + last_write_checksum: sha1:782f5a9dc93a493540470fb89bdb03743b1584e6 + pristine_git_object: a129ca8252cf0dfe1e64473dac38a0068e3f45b1 + docs/models/components/publishresponse.md: + id: e31e05fdaf9a + last_write_checksum: sha1:0c832e5dc71fcb6318e0f31353c43a13341e5e2f + pristine_git_object: 4fb2aca03bf8acf00433eaf24c71a5c8156c3846 + docs/models/components/rabbitmqconfig.md: + id: b754a3c2f712 + last_write_checksum: sha1:bc0cde827dd8191d20f53709d810c96f139b7170 + pristine_git_object: aca91aa6254990b2e2da232dc5ac3aca569c9385 + docs/models/components/rabbitmqcredentials.md: + id: ff67acc94cd3 + last_write_checksum: sha1:fe4394a2c02b5a03f5dcd833274ce8fde0cfa334 + pristine_git_object: 5fa7182a77baac0d46c7ef0a255e7f190c587568 + docs/models/components/security.md: + id: 54906b49ea28 + last_write_checksum: sha1:80bb63282b23ea839838897871598f0c34108c10 + pristine_git_object: 32edc6479e69738e322736841db677590d6b88de + docs/models/components/successresponse.md: + id: 1ae417c0a56f + last_write_checksum: sha1:75f1b243b3ef273c05ef2508005915b9a7fe2567 + pristine_git_object: 621589d968145c22ff055564e30371e2aad8494b + docs/models/components/tenant.md: + id: a8a770edd971 + last_write_checksum: sha1:c21d0475b2131f17c3c68d232612e6f24f7cc9b1 + pristine_git_object: b2626a9f61c0a68ac2e6a8a10a0029380de492d4 + docs/models/components/tenantlistitem.md: + id: f0c3c828671f + last_write_checksum: sha1:a4e1083500a03a8b3b8a9e965399569e472653f8 + pristine_git_object: 196a0ddcde7c6564a8e5e44bd31e89ca156444da + docs/models/components/tenantlistresponse.md: + id: e3e398b5d9ba + last_write_checksum: sha1:c6166cfdee362e330be4941e880f41fcbe384666 + pristine_git_object: e64d423dfd76f670a8c4d2b6124f4c7e0f6cd521 + docs/models/components/tenanttoken.md: + id: "107345815042" + last_write_checksum: sha1:bc9b14e980febc671b7fa28149ed8f639c879146 + pristine_git_object: 1a68f6f232776d106ade3239e60461d51ccd55f3 + docs/models/components/tenantupsert.md: + id: c61842c48e12 + last_write_checksum: sha1:da315846fc460a96dd2cf37e6929c0a7e8a288a7 + pristine_git_object: 4d2bab11ba14705a8b46a70e7910265dab0bbaff + docs/models/components/tls.md: + id: f5383ff05cf7 + last_write_checksum: sha1:1a65ff1b44bd68c8bcf1d8bc74d15ab7197467a9 + pristine_git_object: ac5a53cc1d352c3f140e6bf65eaf29d272102480 + docs/models/components/topics.md: + id: 80428a81a84b + last_write_checksum: sha1:73a2c153be8ad8ad6151428c9c899e928babb8d1 + pristine_git_object: cc053949798cf3aadf62edfdd87a19a9a41fef44 + docs/models/components/topicsenum.md: + id: 9556e9f4c337 + last_write_checksum: sha1:667ac45fa18e3633ee865dec1ef243fffe1395ca + pristine_git_object: 4a86d60a643d13ee65f1bfd13cc2cd03a42f80ed + docs/models/components/webhookconfig.md: + id: a93975601f79 + last_write_checksum: sha1:ba115e3211a3227a42c7b21dbaaadef31c23e0cf + pristine_git_object: 0fd9836e7b869c9e42c3a70ee4aec88fde43fe68 + docs/models/components/webhookcredentials.md: + id: b84a317af170 + last_write_checksum: sha1:8a749ae8486e0e8248084cba75c66a31ba940c6c + pristine_git_object: 567982c213db3fa5e2d9e4b7f75db9d933a33265 + docs/models/components/webhookcredentialsupdate.md: + id: d6b56d9278f9 + last_write_checksum: sha1:5dc37e07b72dfe5e278ca7fb8a0be4af1c67a0d0 + pristine_git_object: aa163807bbcfdfce0e427ef589fd70bd4a6b95df + docs/models/operations/createtenantdestinationglobals.md: + id: ed4e290e9c4d + last_write_checksum: sha1:43e23fd8f8146f5d317543c6c8b03a4074ff2b64 + pristine_git_object: 0077388f5a6a4849b3c5ff019e045292c895936a + docs/models/operations/createtenantdestinationrequest.md: + id: 5c201a2c92c3 + last_write_checksum: sha1:b2e09d4d394b003de3e106650192d89519741a5a + pristine_git_object: 529ab84f5253c2da2dd80614f30dc970fac546ac + docs/models/operations/createtenantdestinationresponse.md: + id: e9d68499b7dd + last_write_checksum: sha1:556fa267998636fee1eda7a41a6890bbd6e7138f + pristine_git_object: 0b989fce6d891f9d777fc7ab1537dcf373b718a5 + docs/models/operations/deletetenantdestinationglobals.md: + id: 2b4cc67e333a + last_write_checksum: sha1:908c897640876ed42f68e6734381aa3a5d5c0519 + pristine_git_object: 2b2e94a9419b8c7b956ebe2528c7c4d676bc9776 + docs/models/operations/deletetenantdestinationrequest.md: + id: 4bf9f875c288 + last_write_checksum: sha1:bbfa31b14e70803e1badfbe034051d6fb61c5de5 + pristine_git_object: 6258902371be3bb5b90cf04596920d27a1dba2be + docs/models/operations/deletetenantdestinationresponse.md: + id: 94d5ea3af3df + last_write_checksum: sha1:23588a326b2c8634f5d0dce0d1a9de9c961ad237 + pristine_git_object: 432caab53d97d7d76146cc60eafe31b562231576 + docs/models/operations/deletetenantglobals.md: + id: 10688e9632cd + last_write_checksum: sha1:01a8abbf49baa6941236e7a3882b9af304ef6727 + pristine_git_object: f7e862c125ce4de64772b100a8ac223839ce6430 + docs/models/operations/deletetenantrequest.md: + id: b983367702a8 + last_write_checksum: sha1:2cfcf2fb425c252a7b26bb1a6349899f0887dbb8 + pristine_git_object: 860f325f1875853b739e422b7cbd68003322cbef + docs/models/operations/deletetenantresponse.md: + id: 53843bce2519 + last_write_checksum: sha1:a828d2a069753790c3fae3c31bedec6b93b1cac3 + pristine_git_object: 529cf112c7c2366ca3974ba45ca4e1aa5899e84a + docs/models/operations/destinationid.md: + id: e575ae5f085b + last_write_checksum: sha1:6f52fb0fbe5553c6f47913eaf768a7fca8a0fe00 + pristine_git_object: 02e965f7665be344debeef858185f0428f66f96b + docs/models/operations/disabletenantdestinationglobals.md: + id: a46f379a89f8 + last_write_checksum: sha1:e7a744c7c62de267096fd21efec311c7af5ab9da + pristine_git_object: 6d1351fddc072ab78c5fcefb1ed6b99f8ed62c58 + docs/models/operations/disabletenantdestinationrequest.md: + id: f1eba2d52881 + last_write_checksum: sha1:284cf58e29d486b82d248daae0f271e75114f0d1 + pristine_git_object: 67662b1a89bbe1da9d455af484c9549453bb9548 + docs/models/operations/disabletenantdestinationresponse.md: + id: c013f51d3cf8 + last_write_checksum: sha1:f5abe251da2b552bfe42b81f176cce002d22242f + pristine_git_object: d6a4f54e900c521fde17667e68dc1dafd7ee7fa9 + docs/models/operations/enabletenantdestinationglobals.md: + id: 101c2dda353c + last_write_checksum: sha1:7ac63aecf59be299705a2ffe5cc8425e099c6d1d + pristine_git_object: e1a01621cec63630e3cdc61bcd6a396e268c7385 + docs/models/operations/enabletenantdestinationrequest.md: + id: 8ab704c59cb2 + last_write_checksum: sha1:e4af3e68f2d6e4fed9f952631b15c86ca31942fc + pristine_git_object: f5b082966a5509d02f3d650f875ce8de8447f543 + docs/models/operations/enabletenantdestinationresponse.md: + id: b795ac6783b2 + last_write_checksum: sha1:bc61c705302651aeeed1e3cb65f4c3880fb35825 + pristine_git_object: 36fdba2e3a1e447f386a62fe5b70a452e35a59e6 + docs/models/operations/getdestinationtypeschemarequest.md: + id: 28942fdcd1d3 + last_write_checksum: sha1:ed8f7c4097f53083f3f54daa42260654bc90edcf + pristine_git_object: 7ff45cf651b7d30fb5c63cbd85e29da07fe055aa + docs/models/operations/getdestinationtypeschemaresponse.md: + id: ddc808c51d22 + last_write_checksum: sha1:55ba8aca411d0c24994bf9337502f10717506c07 + pristine_git_object: ad61ebe1c989506ccf92da97dbed7365762a08c0 + docs/models/operations/getdestinationtypeschematype.md: + id: d0a606c7256d + last_write_checksum: sha1:3cba9af8148107efbe24171f7bf7478ed6b2e1eb + pristine_git_object: 40234ba6e22dcd74641efb040c9ea6805942d176 + docs/models/operations/gettenantdestinationglobals.md: + id: 713df7221113 + last_write_checksum: sha1:a9535b5471e25d82a65bedd07f9f54a05b9522fe + pristine_git_object: 5f63ad7f8d10a8f214b625ab70713cb05bf2b980 + docs/models/operations/gettenantdestinationrequest.md: + id: f6dbaa55f398 + last_write_checksum: sha1:2417e1158f54b06a48d33b7ba244b2ee836d72b5 + pristine_git_object: c4a404f1dc7166ce7bfdc998720f33082c56b689 + docs/models/operations/gettenantdestinationresponse.md: + id: 385af443a819 + last_write_checksum: sha1:14fd7e00c4de7a34a64c2c97f7d538bddfcea32e + pristine_git_object: fd07a1415ec1cb4f62f6b8736513cdd1a20ddfd0 + docs/models/operations/gettenantdestinationtypeschemaglobals.md: + id: c0b83c0bc913 + last_write_checksum: sha1:92890360d763efd1c1cbd57b93724389b07d288d + pristine_git_object: 50cfb7e6fafc4e74ed4398b442a254a147b3ad73 + docs/models/operations/gettenantdestinationtypeschemarequest.md: + id: 2b8b8b0f13cc + last_write_checksum: sha1:91967837ec719a3b999c72086b5bc70a13244850 + pristine_git_object: b1b03f97322e5ee1d92d027ea25ac384ac3d941b + docs/models/operations/gettenantdestinationtypeschemaresponse.md: + id: 93e4d49ab173 + last_write_checksum: sha1:9120ee10aa6a51e0610ebaf12733320da4a58a2e + pristine_git_object: efb73e76cf887abf4f5f8ca018302e28b008acd4 + docs/models/operations/gettenantdestinationtypeschematype.md: + id: abda21457cba + last_write_checksum: sha1:5af5739b0a49e8ac5385216102e80a64b879fe12 + pristine_git_object: 8763738c22099ba081d77b2ca16e0168116bb558 + docs/models/operations/gettenanteventbydestinationglobals.md: + id: 16cff608c4da + last_write_checksum: sha1:54438626557615076b42ae1391a44e82af13ba11 + pristine_git_object: 6c7e0439e20e8ab4ec28e65d5ec77083760a8606 + docs/models/operations/gettenanteventbydestinationrequest.md: + id: 0ee43635ef6e + last_write_checksum: sha1:df92a557d98421647270e1e5f1918501babd4c7f + pristine_git_object: 298dc4980d64bbd89b4c3f49991f7f2339acb911 + docs/models/operations/gettenanteventbydestinationresponse.md: + id: dd8f957e23a0 + last_write_checksum: sha1:8de0296655682636e1ecb402e15212cc21f0fc01 + pristine_git_object: 7517a4b3b8cc658705eee98d3c5cdfa28712b9db + docs/models/operations/gettenanteventglobals.md: + id: 41275a19f428 + last_write_checksum: sha1:f9cd1644fcf7b0e41999e343937a0d5b96f53e6e + pristine_git_object: 0fe61e3df5b4163f930bd046ff9f203af671e2b5 + docs/models/operations/gettenanteventrequest.md: + id: 397e4908951e + last_write_checksum: sha1:690a5e3ae911f6d638f5f7fa35a0fd8e22f785e4 + pristine_git_object: d3bc7f427e70956baae86728ca0116c249b1e2ed + docs/models/operations/gettenanteventresponse.md: + id: cc5d66068d87 + last_write_checksum: sha1:52e43ca76ee4f9eee69aea77990ea58d0e4218e1 + pristine_git_object: 9fe387c4bead91fe8f69de8b1d78c608561e539b + docs/models/operations/gettenantglobals.md: + id: 287095e2b3b9 + last_write_checksum: sha1:6f2d7355fc665d4b486e2620fc637bdb4b7c3648 + pristine_git_object: b668966291019055592fd961c102246ded857cc7 + docs/models/operations/gettenantportalurlglobals.md: + id: 2c18e224df96 + last_write_checksum: sha1:30d8de3f510817042a65361c0d7a20c087581b74 + pristine_git_object: 23639fea8ef7749b15ff08321d9c7a9b4841bdb7 + docs/models/operations/gettenantportalurlrequest.md: + id: ead888c7c189 + last_write_checksum: sha1:c470dd93a0f90607141fc8a30f9b5f40062bba0d + pristine_git_object: 3d20ddf7de0b499764a63c6527d09756ddd83dbd + docs/models/operations/gettenantportalurlresponse.md: + id: 3605c3484f78 + last_write_checksum: sha1:af4b1345c9be80634aa1812da3554572005bddf8 + pristine_git_object: 18ecf8ffe6baf6a6756ce7317b1f9a7d97ad41f9 + docs/models/operations/gettenantrequest.md: + id: ae7951a9bb57 + last_write_checksum: sha1:a98c09eabaf3956879469df3f82b7d2ccc3e5ed4 + pristine_git_object: 1689aa325a91efc0501e201fc7dd1b7b13471ffa + docs/models/operations/gettenantresponse.md: + id: db0db32e96bb + last_write_checksum: sha1:73f5e9531b466ab431678c103ad8bdcfa58568b8 + pristine_git_object: 511af08dabdbd2b2169d34b5baa1165c997b817c + docs/models/operations/gettenanttokenglobals.md: + id: a2e8ca06b248 + last_write_checksum: sha1:38c4e6729a2fae526bc79dd42a48436ca7ba23a9 + pristine_git_object: d0da03191cc0fd20063a3c2df581d419600b6f5f + docs/models/operations/gettenanttokenrequest.md: + id: 894815c0e5a1 + last_write_checksum: sha1:5c96311bf36332a98483a45ae7b6c4938743360a + pristine_git_object: 857c9c960f8ee135bca1b3c3e1c5a116139ae880 + docs/models/operations/gettenanttokenresponse.md: + id: 5e12e9b07294 + last_write_checksum: sha1:c856041206c1a48dbcbf8a7c24070da2e82281cf + pristine_git_object: 46e9b91ecaa9b191f0088a969e5b6d7a26c21d3e + docs/models/operations/healthcheckresponse.md: + id: 28b498fd7474 + last_write_checksum: sha1:2f03bcae525a12e89975fbd1fa1fcfd4ea862d7b + pristine_git_object: ad03cea1d4b2ef2c604eb34ead27cfbd93c1d72b + docs/models/operations/healthcheckresponsebody.md: + id: 1b7e154a7595 + last_write_checksum: sha1:f9cf4d07099db4572a4ce49db015dbe176de1745 + pristine_git_object: 1cb88348b0ddd756de32dbc968f27bdbad2eaecc + docs/models/operations/healthcheckstatus1.md: + id: c6ffbd9570c7 + last_write_checksum: sha1:d73bc367d40fcf4a9490d4aaf59bd042a0e823d4 + pristine_git_object: f25dda9881de42cddeb7d2dc6f053e71c91b706f + docs/models/operations/healthcheckstatus2.md: + id: feeef22341b6 + last_write_checksum: sha1:490ab4aa4df19d80347c593b58516e90296deec7 + pristine_git_object: c32a422454080598ad7d643676ee37df77ffc054 + docs/models/operations/listdestinationtypeschemasjwtresponse.md: + id: 4e2ef878de3e + last_write_checksum: sha1:718d47377fc9434a2c7cc0fae168f0e9034e8cc8 + pristine_git_object: 25bed7d51e835ed7af416075bb306210501739de + docs/models/operations/listtenantdestinationsglobals.md: + id: 7f6422bb61ea + last_write_checksum: sha1:013a2c496c66cae9098fe3c37572811804ff1017 + pristine_git_object: 7dff79979664e8d64063b58a9b3ccb56afd93767 + docs/models/operations/listtenantdestinationsrequest.md: + id: 76b4ddfe6a6d + last_write_checksum: sha1:781c65ce1456c2bc68bb950d9470de6af4acd9da + pristine_git_object: 93bf8ba0189b7163196d8568fb7e9de9c26a0eb5 + docs/models/operations/listtenantdestinationsresponse.md: + id: c0ed91b39419 + last_write_checksum: sha1:9231f0909a88a62f6d653a791915012edecbf527 + pristine_git_object: 6859c6b605a9398743b4413070b7057633394b86 + docs/models/operations/listtenantdestinationstype.md: + id: a20b115e8b0f + last_write_checksum: sha1:507f9cda808e10dc51d69a4841b01f58206c3324 + pristine_git_object: db505082e24de08cdf0130de5533caea8babe060 + docs/models/operations/listtenantdestinationtypeschemasglobals.md: + id: 4ae69c80cc95 + last_write_checksum: sha1:bee0f55fcdee6179d9d128c8781ef8b05fa6469d + pristine_git_object: 589235e0d7ced91d7f9128a23699314cb311d6ed + docs/models/operations/listtenantdestinationtypeschemasrequest.md: + id: b97c29a3d326 + last_write_checksum: sha1:e0755dbc55de5b6968e2714f76978d8a06e4f84f + pristine_git_object: 402e89f5d9d35049b59e9359e1738193587d7492 + docs/models/operations/listtenantdestinationtypeschemasresponse.md: + id: 26fe5e3ffc64 + last_write_checksum: sha1:3cf010fb450c1e3b73c3d172afb174803a982410 + pristine_git_object: 567fbb30a40db7ab4c6c57fb215f0cfae3a57d83 + docs/models/operations/listtenanteventdeliveriesglobals.md: + id: 5db3c9ef5f89 + last_write_checksum: sha1:3dbaa3abf247c6c4cec5aa9e6e5b3209bb29c71e + pristine_git_object: d094ac8fac29e8e70b8f24366c38a968bf4525d0 + docs/models/operations/listtenanteventdeliveriesrequest.md: + id: 0205c768f9c0 + last_write_checksum: sha1:94302a607b016b49225bee8734a94618151c0978 + pristine_git_object: 37025fa2d1f0905e1c1013cb53e0735fd2e30e78 + docs/models/operations/listtenanteventdeliveriesresponse.md: + id: 2c9727ac8f37 + last_write_checksum: sha1:916a7704207fafe0a59c6a995cafb2680b4984fa + pristine_git_object: 342642bf513a9480231e06224a0a85e08b4fb1c4 + docs/models/operations/listtenanteventsbydestinationglobals.md: + id: 2ad95903f115 + last_write_checksum: sha1:d16b66c5de03626258387ef40a24a6b3fc35b1ab + pristine_git_object: 0187b03d9ae9e0122e0ccab52914df04d491a9c7 + docs/models/operations/listtenanteventsbydestinationrequest.md: + id: c207edaf71b8 + last_write_checksum: sha1:0724b4223b6ffde9bc7c728c0705ed0dde22d5f8 + pristine_git_object: 3531a6342344d9e0ded2754130ba17e617b04568 + docs/models/operations/listtenanteventsbydestinationresponse.md: + id: e9d69adb36dc + last_write_checksum: sha1:9292391d1c3002079023963b9abc7224adc40dc7 + pristine_git_object: 7e8d820ece407b74b2b6e7fd76775829892c7d47 + docs/models/operations/listtenanteventsbydestinationresponsebody.md: + id: 21df1a9f12ee + last_write_checksum: sha1:d38466d12e091fd32a9b8e1238d43159b655339f + pristine_git_object: 404b319d4d16b392b6a47792a8ef2f943d04bd25 + docs/models/operations/listtenanteventsbydestinationstatus.md: + id: 887bb9af7442 + last_write_checksum: sha1:11c44888c11428180e88a4c9866cb78a114f590e + pristine_git_object: 17ea8b21b58e3511ed187037c5458e055ab74f2a + docs/models/operations/listtenanteventsglobals.md: + id: c310ffe0658c + last_write_checksum: sha1:2b41617734c90726484278e01ca514828a7692a6 + pristine_git_object: c046fba2bdbaa3c24cd5e2a7aebd1a2f023c4b03 + docs/models/operations/listtenanteventsrequest.md: + id: 864855d4c940 + last_write_checksum: sha1:c052c12acf1b465e5cc776e7c6f684f95847ab57 + pristine_git_object: 35bae6a92c78a2f97c65c3794f1bf6e28c5233e2 + docs/models/operations/listtenanteventsresponse.md: + id: 13c2667235ea + last_write_checksum: sha1:9bf9d3827ac01ba3e5fbc0b93c06df205bfa848c + pristine_git_object: aedf50891a14a3c18af96da00ef82ba4ec7c1354 + docs/models/operations/listtenanteventsresponsebody.md: + id: b06c193eed0f + last_write_checksum: sha1:ef56aa89328de913a56751eaa3a3aecf47b507b3 + pristine_git_object: c63b5e750a8e876f49d11911a280c936fca45259 + docs/models/operations/listtenanteventsstatus.md: + id: a94fcd5ae97c + last_write_checksum: sha1:170b653d18a29431cb482f91c71a4ef56a0c7f21 + pristine_git_object: 6f9bfd4d2fc5b5cbb31785573e4c8cb20ccacf25 + docs/models/operations/listtenantsrequest.md: + id: f550d84e5a64 + last_write_checksum: sha1:e1f863de6b8c1a8b355a805413b95eb1435b858e + pristine_git_object: f57b050044fc29cf9f4684da5fb46cd65043765f + docs/models/operations/listtenantsresponse.md: + id: f9d4a4333302 + last_write_checksum: sha1:e2abf9cfd3f8a0b4d37c0f1081331579dae17439 + pristine_git_object: aed34d28634766641b5ae4689da9267c43727ded + docs/models/operations/listtenanttopicsglobals.md: + id: b6e144d4f2d8 + last_write_checksum: sha1:f7a03bb545264de6a52a6c473a469062f0a8dde8 + pristine_git_object: 2e06a702959f81fd97087e6f5af4e84ae6fe8b61 + docs/models/operations/listtenanttopicsrequest.md: + id: 8abedaa01c83 + last_write_checksum: sha1:5fcab368c01ee7ea26eb1193a0e4866e13b8ae5a + pristine_git_object: 7e0e268282f222c825b408f1c06c9bd69cd8a926 + docs/models/operations/listtenanttopicsresponse.md: + id: aa7223c68146 + last_write_checksum: sha1:5871725043dc594cae1bee608a8ba3c781dec54d + pristine_git_object: 11f759097f683d20b0710819981259df0d936859 + docs/models/operations/listtopicsresponse.md: + id: fbb3bbcae195 + last_write_checksum: sha1:3ac5e656f0f779f255d414a3651ff74161f87d0c + pristine_git_object: 5bc8757291b8307f42ee6f32e906366db1c718fd + docs/models/operations/option.md: + id: 2ac1bd52a5fb + last_write_checksum: sha1:08cfee5d266c9d82987e448f6c98a143aa42c5f8 + pristine_git_object: 35d8a1e2ad48a64702c6a654ac8880dabec053b0 + docs/models/operations/order.md: + id: 97e3e83e5b11 + last_write_checksum: sha1:d7f24418c86713f9478df30a794a2b8dbfed4329 + pristine_git_object: 4f3c15d9b687e347f0f8bd4168d760a202a49381 + docs/models/operations/publisheventresponse.md: + id: 61a8830f15e4 + last_write_checksum: sha1:e97a86d198aae858360037ce27b249a63e93b186 + pristine_git_object: 01c3deb25a2826d44bfa80ece7b0c43ac2300320 + docs/models/operations/retrytenanteventglobals.md: + id: 63fee39c8037 + last_write_checksum: sha1:ffa85c717b289d0469fc2e5158e351d9e7a2e30d + pristine_git_object: 0116663a18fd15726302675fba5d966ca19b8150 + docs/models/operations/retrytenanteventrequest.md: + id: 2f7ee865ea94 + last_write_checksum: sha1:f6af9759b71e0a50606b0e4af0336f99360dfb59 + pristine_git_object: faa8775b05c0c206ad5e4941f8aab5d087714299 + docs/models/operations/retrytenanteventresponse.md: + id: 93febd72c095 + last_write_checksum: sha1:d85d02b3c23633043eb2a77499c1aa342de8a592 + pristine_git_object: 54f075764e849dfc92dcd25998063be0f06f423b + docs/models/operations/theme.md: + id: 2f9a390ad334 + last_write_checksum: sha1:17aa1584a9efdf21597963c4238c3bf368bf5b94 + pristine_git_object: 6525942d5b17ebdfc7bb91028b1d23282e13fad9 + docs/models/operations/topics.md: + id: b18fd8c48c1d + last_write_checksum: sha1:3117a14366c845da7ce98b2d2fffae421d3ed347 + pristine_git_object: 166527decf58d09a4d31647984ea5f5540e268f1 + docs/models/operations/updatetenantdestinationglobals.md: + id: 5284e92a77b7 + last_write_checksum: sha1:4aba3d6c33af9d917b7b6061e82ae5a1719c8016 + pristine_git_object: 9bf03b659b342896eccfe264ce99b2c1667c3cc1 + docs/models/operations/updatetenantdestinationrequest.md: + id: 3806f88d7729 + last_write_checksum: sha1:712075fe05808ea1f8e2b3ba9003f4563f69f320 + pristine_git_object: 330baa42d311a6c20fba02fd84541578565bb7ea + docs/models/operations/updatetenantdestinationresponse.md: + id: 7f18084651f9 + last_write_checksum: sha1:4c116dbcef518b56d72d0cc3ee9aaec6ff34a8f9 + pristine_git_object: 51961e78c5dc6194705d9fcbc9d6f275c75ceef6 + docs/models/operations/updatetenantdestinationresponsebody.md: + id: d1a2264d869f + last_write_checksum: sha1:7acb9a950055a7639a42ac25d7cbf6eb3ad4f38d + pristine_git_object: 683196fa4f36acea250f84550f98047a73f37754 + docs/models/operations/upserttenantglobals.md: + id: b42eb3f13fe4 + last_write_checksum: sha1:c29c2f4d59f2597e0a9f083299fdeb4169dbfd7c + pristine_git_object: 18909bae01af222c588068f35e69f4bb08123414 + docs/models/operations/upserttenantrequest.md: + id: 7df83dab5d53 + last_write_checksum: sha1:fd26dd8263ccfb82eb6f116524d692cb0bdca0ff + pristine_git_object: 23138085f47dfd6115e5dc46092254e07b5ba51e + docs/models/operations/upserttenantresponse.md: + id: 06d537ccfe54 + last_write_checksum: sha1:ff5e08d7322f8877539f84ac08fe3df524db5aa0 + pristine_git_object: da3ad4e667eea8405b78fd2857f019d94b783394 + docs/models/operations/workers.md: + id: a10841a82928 + last_write_checksum: sha1:96557346b37deb991d9935c1e2f2a47f0c18f38f + pristine_git_object: 2ee4dd095128cac6926139658e39e3e815e51396 + docs/sdks/destinations/README.md: + id: e83d288899aa + last_write_checksum: sha1:0bcaa980aa67a7294970bf306caa777881ceff80 + pristine_git_object: 9651cad8586ef76207218cce09a60d585fe8e437 + docs/sdks/events/README.md: + id: cf45a4390b9b + last_write_checksum: sha1:adb5b72dae4a08dbb6cd9f2f679eefcfa652fc84 + pristine_git_object: ae23c34815ebc0ffce56c444cefd3b7af8784e25 + docs/sdks/health/README.md: + id: 5082c50d5e82 + last_write_checksum: sha1:23157d5489dfa44c296067f57581ada0ad7ee463 + pristine_git_object: 56cf1acd9d15018b231328e0cac0f84a11f4af5f + docs/sdks/publish/README.md: + id: 370ef5537c93 + last_write_checksum: sha1:164015b4bda4ec641bd70a8fd17ebe014723cfd2 + pristine_git_object: 8a9c8428ca9faa7d377e5d7467c53303c1253fb0 + docs/sdks/schemas/README.md: + id: 26a0abac640e + last_write_checksum: sha1:a12395dca9f184d406df65dedde5ef95e6153a47 + pristine_git_object: 485c2310d17f13e002efe773d13135dc66838c4e + docs/sdks/tenants/README.md: + id: 68a2b19779b5 + last_write_checksum: sha1:b6e46ca888988d52844904450ead6d7aec18c152 + pristine_git_object: b408dac70c113432b42e4b76a37580743d1e2a77 + docs/sdks/topics/README.md: + id: db4aff1adac3 + last_write_checksum: sha1:199354b65065c10b9214bd17a2bdeddcb61a9abe + pristine_git_object: f700935b1ba5f5ef3ce9a6b07327cc8af1864031 + events.go: + id: fe26b3f87ab7 + last_write_checksum: sha1:c45971a645260d3570f794229588880f5516d437 + pristine_git_object: b3abea62a40d27c9777bc9081739df394d011589 + go.mod: + id: c47645c391ad + last_write_checksum: sha1:79dd70b8063184ec2aedf2a926c867febdda9263 + pristine_git_object: 5dd9b9351841dfcd9fb261d2f83a2f1884fd0753 + health.go: + id: ca291aa88e47 + last_write_checksum: sha1:c77cc7ff78cb172da1a404e7562b26ca5bf6afb4 + pristine_git_object: e8f7dd3e3faa97b71b1ac63d47f72f0cae78c28d + internal/config/sdkconfiguration.go: + id: 33b8bfac5265 + last_write_checksum: sha1:a0963eb2e7c757787288f1bebb715071fc9b1794 + pristine_git_object: 928bac6646ccc58827252ae2987f8fb336a9ed80 + internal/globals/globals.go: + id: 9b8514db7dc7 + last_write_checksum: sha1:c2fc1397577115c575802581a9cc51f4c29649b2 + pristine_git_object: 7d6947262e609c0549545fab39707747e0d789ca + internal/hooks/hooks.go: + id: 336be70ed5c0 + last_write_checksum: sha1:fefc5ff8bf40bc471154b9f499f5a68bf9129982 + pristine_git_object: 4264c1814ed09f0fe95ae0b91e30f52dc33a61b3 + internal/utils/contenttype.go: + id: 928a56fe6755 + last_write_checksum: sha1:ab5cfd860d02c6e6a37f89e2b5649a9859947fb1 + pristine_git_object: f6487e01eb987c0aa49e7aa50b5ff24830314c63 + internal/utils/env.go: + id: ac8bab30c73d + last_write_checksum: sha1:1e0bcb2d2caed9f3657f1dbc99b55811bed0298c + pristine_git_object: 110d464eacf2387b347bad1cb903666354a339e9 + internal/utils/form.go: + id: 8ea133d76535 + last_write_checksum: sha1:e4d449b9dd7274318a11bfc1e106909edf392c73 + pristine_git_object: 33162f7fcdaa09a1c1af1451db512f85963a9871 + internal/utils/headers.go: + id: 90d4f18d4adf + last_write_checksum: sha1:5bebe44910a8709c6a0204b79436a13a6af59ed7 + pristine_git_object: dc9e1fde9df65c30cd3a7ed3598d132b132528fa + internal/utils/json.go: + id: ad03e3c502d8 + last_write_checksum: sha1:04ff909542d347fcf7cc7e8cae75026fcf2988bf + pristine_git_object: 3e1150a49eb9a6f436c42693c56ebde3226d7c84 + internal/utils/pathparams.go: + id: 1f3e0c30fd90 + last_write_checksum: sha1:6f59c72b7d953a2507689b4beb0e4a83d1f6458d + pristine_git_object: 78542fc1c41ca7f23b8513ffafb47d6678b56685 + internal/utils/queryparams.go: + id: e7f604e65a58 + last_write_checksum: sha1:4125808876826806bae31346f6c8b1883bbf384a + pristine_git_object: 5143c4f03948fa7c885ae3e901a98ce4c42d2295 + internal/utils/requestbody.go: + id: 22445ec1c044 + last_write_checksum: sha1:9e211017b30ff7ed2f8ecfa7f03e8d2473f6542d + pristine_git_object: b391f6009a13c76eaff0f0ec9bae91fa55da3e63 + internal/utils/retries.go: + id: b5e011d15c2d + last_write_checksum: sha1:126451276fac69a7ea1a524e186f27aa177b509e + pristine_git_object: 1f4f8c94b284e93b4caaee8e7b5b7f582f315314 + internal/utils/security.go: + id: eeb54c55241b + last_write_checksum: sha1:bb9cc1870101f6d2a990766f3eb0ea37292f7507 + pristine_git_object: 19dfa6f4607dea64b1dd61c211e072212e7a3cb2 + internal/utils/union.go: + id: db86c85746b6 + last_write_checksum: sha1:08ba9097091619af0438094533f06c5693f9aeaa + pristine_git_object: dfff6f64f7838452c4caf663abb6fbdbb5b8f76f + internal/utils/union_test.go: + id: 4b56247171bd + last_write_checksum: sha1:83ac73c1901de4c6db90f65cf5879163f3d47a00 + pristine_git_object: f66814c73ace94d8e71d785fd6161fb405745754 + internal/utils/utils.go: + id: 1133b2a27019 + last_write_checksum: sha1:d88d96cc244301d137581432095043f27a3e17b0 + pristine_git_object: 0415b536598baa76c5d1a8fc32816ed1b83f9137 + models/apierrors/apierror.go: + id: 4cecf27a5a54 + last_write_checksum: sha1:e699d3325ea82ea2b0d29656396210f0513c3391 + pristine_git_object: 61a9628a6533548245be5af929f1d4f96dd780b5 + models/apierrors/badrequesterror.go: + id: 7906828547bf + last_write_checksum: sha1:93fa266a5ee9549a8ef7f7e067b1a0fc65ca4baa + pristine_git_object: 3188e1c4e299e19f634fddfc8cde643716439a8c + models/apierrors/internalservererror.go: + id: 67f9cabb9e17 + last_write_checksum: sha1:40533221371a1c6e637c5e9abbf942d1618680ed + pristine_git_object: 874fc31b170b670c25959f4ed9c706879b1471c3 + models/apierrors/listtenants.go: + id: f17213bf12b7 + last_write_checksum: sha1:702f4b25e02f7167b1b53f145a9cc00636ee86bf + pristine_git_object: 50c25b1c4d9725c5fa590efb30b1dd445301d23a + models/apierrors/notfounderror.go: + id: 13ac4fa029b6 + last_write_checksum: sha1:f119364cb444146d4287732661dfb839e51e81ec + pristine_git_object: 927957c1b08b1a2db0693e54ac176ea3d6824bd2 + models/apierrors/ratelimitederror.go: + id: 8be106834928 + last_write_checksum: sha1:0acf9b0d68d6b4052e950399693121317bc63237 + pristine_git_object: 770ec80364ecd2484ca010af5453f60c0e749313 + models/apierrors/timeouterror.go: + id: bed21999997c + last_write_checksum: sha1:04500c179586a95c95b260388d5d7c77f102822f + pristine_git_object: 0a950715a89e5591b9d6bfb50a6535c0eb53a575 + models/apierrors/unauthorizederror.go: + id: 4b81aee5e7b1 + last_write_checksum: sha1:495a2ee0beae62a009ce4b8cb0a40167e009555c + pristine_git_object: 7a24725d255c9bb5620dcd8e128b1b9b4965469b + models/components/awskinesisconfig.go: + id: 8b76da890cd1 + last_write_checksum: sha1:f29a7389f3ff97c3d1ef8c9eb0563b545763da48 + pristine_git_object: 59f71467966fd71b750e9c151729fb27c395c39b + models/components/awskinesiscredentials.go: + id: 200646bde776 + last_write_checksum: sha1:865cb496ca2e4e997dc4d586835cdad736e73cba + pristine_git_object: 9b55f6eb047efd60eac85c1791215d632c291cdf + models/components/awss3config.go: + id: 197d430bd23e + last_write_checksum: sha1:1599ab337e3d5c5fdc176138f3c525542abfb405 + pristine_git_object: 74c486996d41a10e2e3218e9937b38957382660c + models/components/awss3credentials.go: + id: d2abe7d8a2c5 + last_write_checksum: sha1:235acda263c87201de500c28a0251a54a024fa5d + pristine_git_object: cd6c8556cb8b6564650df9f5cd94877f3d50f9b4 + models/components/awssqsconfig.go: + id: c5bfa0616d45 + last_write_checksum: sha1:5d39dcd9cf597f7c7daedcc0bd84f0167cb80198 + pristine_git_object: 4e4c3e69c829337ce74a498c43da281e41e3428a + models/components/awssqscredentials.go: + id: 82ff879c37ef + last_write_checksum: sha1:818d1a5d9ee2eb74af3cc2023b28aa78fdf2cb97 + pristine_git_object: 928726dd3ba772963977562e2861b22c8225e495 + models/components/azureservicebusconfig.go: + id: 3a89311132b1 + last_write_checksum: sha1:dc322c63000839f85738412b92771682a7dc75e5 + pristine_git_object: 59adc2eaccdbdbabe63a8fd4dc4f07b5f39df81b + models/components/azureservicebuscredentials.go: + id: 86d7936a478b + last_write_checksum: sha1:aaa8e7d6a638df94096aca0cd23b25a730897343 + pristine_git_object: 1fbdfce89dbeb47dc3151d1f6c1123fae0af6654 + models/components/deliveryattempt.go: + id: 6e189cf6bab4 + last_write_checksum: sha1:920655ae90a154256812fcc610640ae7f3022501 + pristine_git_object: c16d4782dce0d706a976fa0ce7b673602c42fc9e + models/components/destination.go: + id: fb3cf6ee9049 + last_write_checksum: sha1:079b0534b918a4aaf4b51bb8f0557cee19a6d1f8 + pristine_git_object: da106f19b295d1f4e7f11c960852b1030cb63047 + models/components/destinationawskinesis.go: + id: 833f1ed53829 + last_write_checksum: sha1:fb9bc8afa79caded64dc9c340b924de0709bf928 + pristine_git_object: ce2cd73038d60fa285c133e3ab84e725e4379c49 + models/components/destinationawss3.go: + id: 4dd2b7e18110 + last_write_checksum: sha1:4d362f5df6b40b6a191247615274c874a877c5f9 + pristine_git_object: 320ed12006b8d8e8c0b6b7a47a40e144c2ab62bc + models/components/destinationawssqs.go: + id: 1292078f8606 + last_write_checksum: sha1:d74f3228f931b8071598e5b6ae6c798bf4d46ac1 + pristine_git_object: 88b3884a92568e71cd83436d1c9ae485634b2a32 + models/components/destinationazureservicebus.go: + id: 0ffc168d9881 + last_write_checksum: sha1:b8b06cbf2d81c24b6f816cfec4692bf9cb92adcc + pristine_git_object: 9d8763993138b07bcfc6f77e95ae55f3a943620f + models/components/destinationcreate.go: + id: 3860dce59b4f + last_write_checksum: sha1:4b89340cfb20eec9b076e349cbe51e9a8f1589d0 + pristine_git_object: 166aaf8592510ae439f1a36bbc9ce186dcd771dc + models/components/destinationcreateawskinesis.go: + id: 716114099c1b + last_write_checksum: sha1:2c74f223bcd87f511d5ed543371be9edd058c7b6 + pristine_git_object: c7b663bffa72d37db8036b5ab4d628c960bb258d + models/components/destinationcreateawss3.go: + id: 7bea39e95ede + last_write_checksum: sha1:68bfd472d0f99ba15bdcb392815bb44664ef3035 + pristine_git_object: e8a39dc39893be0cf20b7ea44ffad3cbd138260e + models/components/destinationcreateawssqs.go: + id: c60d19e6d3de + last_write_checksum: sha1:740c388b393fd7597ee4d267ccadb86e57046d9a + pristine_git_object: 5710c3e0e3ceee1e970cc2c7c6b4141f51ea4960 + models/components/destinationcreateazureservicebus.go: + id: d96c5dcffc18 + last_write_checksum: sha1:3b1240819ee5965719d70ba008d5f5db1a9a807c + pristine_git_object: e7455ce2094ca974912b8890337911c8a03c7e0c + models/components/destinationcreategcppubsub.go: + id: 760cc25f4532 + last_write_checksum: sha1:20240b59b7511030667232e762bb855a11b1f474 + pristine_git_object: 62500abac05bbd0f607d0b6af17e06f3f712d56b + models/components/destinationcreatehookdeck.go: + id: 0b164756ec20 + last_write_checksum: sha1:2a332d30e1bce4bf2705c1a8fefa003dbe56d832 + pristine_git_object: 8ad43871382211a709c9084f642834bb072827ba + models/components/destinationcreaterabbitmq.go: + id: 27cd933960e7 + last_write_checksum: sha1:f9b565de15a6bbec2159152568f6696edb6ae705 + pristine_git_object: ef892b4e8a6f9517734e85fffe051f9ba3fb729f + models/components/destinationcreatewebhook.go: + id: e97a4db7225c + last_write_checksum: sha1:6666c26d7c43266a96b5fc90a533d6256507b8d3 + pristine_git_object: 7bc26668f1bc7ea6b01e0346052d108b5ddacae6 + models/components/destinationgcppubsub.go: + id: d0551eafaf48 + last_write_checksum: sha1:565d7176a3631ecdd32d4dc114bcab87033a2fa3 + pristine_git_object: f6c8b13493eb5713f38828749a17e0d5e01f75bd + models/components/destinationhookdeck.go: + id: d57c67dae33e + last_write_checksum: sha1:24b816be2c0dff30cc38bde956688bb70d5276c4 + pristine_git_object: a2f43ed360c248560737c5b84233f40b45b030a5 + models/components/destinationrabbitmq.go: + id: 95d305da51b6 + last_write_checksum: sha1:adefa3031325310849f0e4b562bec4198407aa5b + pristine_git_object: 07c9ec6992a0a7cedef09a00fde2a73cb26c7946 + models/components/destinationschemafield.go: + id: 54ed09758e6d + last_write_checksum: sha1:4e673c171966efc80b1a36460f39285558e1e2f5 + pristine_git_object: 751f6fa6e0e191631806e6a13e5d58374a3eb9b4 + models/components/destinationtype.go: + id: fc3677283784 + last_write_checksum: sha1:08c04642323577efc63daf63451fc3642f6758a6 + pristine_git_object: 4c1cb7427efe67f49ff220953846367519d3d24d + models/components/destinationtypeschema.go: + id: 61768eb3785a + last_write_checksum: sha1:d19d2b060eac03de1daa427d59c81de0db2fa515 + pristine_git_object: e192cc0034fc10b860807c90464b15cabd4cdfd6 + models/components/destinationupdate.go: + id: eada8377c48d + last_write_checksum: sha1:04b62b5e133e9f0de06e95699764135635fe3d9f + pristine_git_object: 7ee37d76a1620d58bde42bc5f2a77c4838c66e52 + models/components/destinationupdateawskinesis.go: + id: 3282bcbfd9da + last_write_checksum: sha1:9db66bcb81a0f6cf9c40c2cc0c8c5bead454956c + pristine_git_object: ba573a577db66306d3ae247aee1134a27c01f14e + models/components/destinationupdateawss3.go: + id: 79a4859f0cea + last_write_checksum: sha1:13224f40a2cb09ea05fedb1d29b5bd33026975a0 + pristine_git_object: ddf43859d71a62c755134054f134ce9cd0f3a5c4 + models/components/destinationupdateawssqs.go: + id: 23190d1a3d21 + last_write_checksum: sha1:211d98b6114a01c5ee222a873e4740128b28d8f0 + pristine_git_object: 24d4f44d9f745109acfc2541c47f07f3c6901686 + models/components/destinationupdateazureservicebus.go: + id: b83a9c557a38 + last_write_checksum: sha1:726e4f56d4deea178c0fbd11bec72117c677f21e + pristine_git_object: 725c755dc025ad1148cda4496a32df10bfda1971 + models/components/destinationupdategcppubsub.go: + id: c1fdf179507b + last_write_checksum: sha1:b4903a8b75c75099b5a55ba9816150eb0c8bae52 + pristine_git_object: 3ebee05643ee9622e0b8b06c6fd07c60275a3469 + models/components/destinationupdatehookdeck.go: + id: 03124d06038b + last_write_checksum: sha1:a048ef56fe0375c2957b0687218bdb0bd9654865 + pristine_git_object: 9e0b867ebfd7486ecb1ef0259f958c9c23740db4 + models/components/destinationupdaterabbitmq.go: + id: 4ee793e05609 + last_write_checksum: sha1:4d14efb80fe54a2a449944d9f9b11a98ab01a74e + pristine_git_object: 69908540baad052827be440ccf4a7c874b3a98ba + models/components/destinationupdatewebhook.go: + id: b4c8c0a38df5 + last_write_checksum: sha1:5349e0b8db84bda239d93f8571ff351c93127ebe + pristine_git_object: f09bfedb68ae58fba67c6570cdb94802bed76f0b + models/components/destinationwebhook.go: + id: 34f9436369a5 + last_write_checksum: sha1:ca548483ffa3f856b286c3bcb6b3fcbcc9b00a15 + pristine_git_object: fe6d5f8371e0867f2e6c74e511e74b3d6d59419e + models/components/event.go: + id: 3382b9f29930 + last_write_checksum: sha1:024905574601bed035a5e8898b1f0e14dec8eef5 + pristine_git_object: 072dd8f73e034455c4865ff8289f690155c20d2b + models/components/gcppubsubconfig.go: + id: d2d3b56c9d41 + last_write_checksum: sha1:2e170005719447bbd61e4c38b30280cf83aaa7cf + pristine_git_object: 9dd5995b62aa2fd5e9eb38e2da8c745a9a32509b + models/components/gcppubsubcredentials.go: + id: b27e3aa1a09e + last_write_checksum: sha1:92451911a46afea75e0d95223fec41e13be6f477 + pristine_git_object: 3e0cbe6716f9690962217a3f3e428dc0918901e9 + models/components/hookdeckcredentials.go: + id: cb8f8a273a4d + last_write_checksum: sha1:e1cdf884d2a7ebe1d27369ca2284f66958159ab3 + pristine_git_object: 1fc05365cb9c7823fc9e6e13824816d683916f8b + models/components/httpmetadata.go: + id: 790bad4a7abb + last_write_checksum: sha1:01a20fcff33179809ff9920ee431c7adabbd98f1 + pristine_git_object: 148ec47fb2dea6c188ec68eb3532d93169608168 + models/components/portalredirect.go: + id: 10570f8d72fd + last_write_checksum: sha1:9ec6aeeef52f427e79b8c8c16f6c77cc2d7fc4b3 + pristine_git_object: bcbeac221b2de4d793efcf85fd773efdb27e947d + models/components/publishrequest.go: + id: 90a166ff55f9 + last_write_checksum: sha1:b111ad6707dc5df05eabf10b014c8f0cf4071067 + pristine_git_object: 58a959b7dd790bda2be88d8c6adfe77427f265ed + models/components/publishresponse.go: + id: 6089f3b51ea6 + last_write_checksum: sha1:cfa90e561c3e6f8545f212b6d2da7fb6ab9eea3f + pristine_git_object: 2aa6c76844e0da45c21faa4150fe009f300b3981 + models/components/rabbitmqconfig.go: + id: cf01b62b640c + last_write_checksum: sha1:7b80a3866422d2259add43ff22ecea80fbb09441 + pristine_git_object: 2f1ba2f810b34541314ebfaa6d87356a0a47d3fd + models/components/rabbitmqcredentials.go: + id: f7023a3bd395 + last_write_checksum: sha1:f6afa39dad66d9e40e0b1f6cade0be69384717e1 + pristine_git_object: 6065ea96ab2ae9ee8be1dede77503150d2caf31e + models/components/security.go: + id: 3a5eba5fe9e0 + last_write_checksum: sha1:3b2fa9b7ec20ffeda1ccf2ca45191fdb89fcd842 + pristine_git_object: 83ae11f56eac2200aef3e36f5b011010ac4edfac + models/components/successresponse.go: + id: 43b43fb7692b + last_write_checksum: sha1:cfbe98fcc6978d6f2b45e55c29a0280c2c9a43bb + pristine_git_object: cfd78c4e71a2074561ae4ef14d7bc6619a9aeed1 + models/components/tenant.go: + id: dedefde9e631 + last_write_checksum: sha1:38fb10f7abcce788ebf8a378450b75367d7cb51b + pristine_git_object: 87a469c8417613b119f697562f96f8f399f82543 + models/components/tenantlistitem.go: + id: 237dd1bd0a5f + last_write_checksum: sha1:6da532433a19163170a4eccec194f09863c49d29 + pristine_git_object: 709945e854277097c241f6f8c6d158141b5a9264 + models/components/tenantlistresponse.go: + id: 9aee243657bc + last_write_checksum: sha1:1d3efa7e73e4498087d4bd6b3d1d286edd2d559e + pristine_git_object: 7c9f969fa3afadc13509b8a5c65780ce1e0d2d70 + models/components/tenanttoken.go: + id: 4fec46556bbd + last_write_checksum: sha1:75309e562ecfc34e1813d690b2daab4a26735ee6 + pristine_git_object: 3c4d2549e76533339e95bf3d1684e5468124905a + models/components/tenantupsert.go: + id: 43c283ce74b3 + last_write_checksum: sha1:2648cf5439dc1c0bf6595f93841b99bf2a0a70a8 + pristine_git_object: e0164b5ac0a6ba20cd37f34356a293b0c8c0b8ff + models/components/topics.go: + id: 1689aaa3da4a + last_write_checksum: sha1:7d6e620952e0660a0466bd914d8b93f6a4093f03 + pristine_git_object: 3426767d1b7beac2677fedbca47679388fb33e97 + models/components/webhookconfig.go: + id: 081453a752c7 + last_write_checksum: sha1:bba801085d750e7808a3a570de6e1238e83475d5 + pristine_git_object: 6b0b2ca94aa3f1b93fff9f8512e9dfe225c3bead + models/components/webhookcredentials.go: + id: d4bd99503995 + last_write_checksum: sha1:029c1203609eb6869377f482ae1ffafbb2760ef8 + pristine_git_object: dd53e67794698ca46857f0e7354b4b4e86652d84 + models/components/webhookcredentialsupdate.go: + id: eec1dd2333b6 + last_write_checksum: sha1:ff5c706fa042109b7364a1c9f0749c3ff9f35016 + pristine_git_object: 4cf95e6375feebad8fac43c150cf86f3e8a4fbe3 + models/operations/createtenantdestination.go: + id: 3e498dd32fa9 + last_write_checksum: sha1:65ca51c100e19c4f9d90fa4d24554f7435426d42 + pristine_git_object: e1aaadd89ef27955871fe2784d997e26f472e990 + models/operations/deletetenant.go: + id: 25bd9d75cc45 + last_write_checksum: sha1:27216e79fbc6478d3c15b2d3b9833e6dd4343e25 + pristine_git_object: 1be3fe6a89ae299ac444c069a33cf9404a7803a3 + models/operations/deletetenantdestination.go: + id: 2330c686919c + last_write_checksum: sha1:0c5a55c3a151a34a489b945c54e8ac7e431d0477 + pristine_git_object: a814ae9c7f2a392e41488abe3460cab1bd5fa105 + models/operations/disabletenantdestination.go: + id: 483cc1e53416 + last_write_checksum: sha1:82e6a0c564f7ca41074970413e779b3e381f39db + pristine_git_object: 2b9f67108cc339d4520da7dd23dbb8e6bd38ab9e + models/operations/enabletenantdestination.go: + id: 8d9f895234c4 + last_write_checksum: sha1:46256666d65da8f2edd870d49c8e7b0c08c65386 + pristine_git_object: 4ef6bcf651b4999778303a3de9aebe843880de29 + models/operations/getdestinationtypeschema.go: + id: 469bb274efa3 + last_write_checksum: sha1:06d4b02ef04c853a88b7cad7805b5a0840b73ffa + pristine_git_object: 9aae18fe08348eaa303c6ea16c77fad8104a6839 + models/operations/gettenant.go: + id: 24249036c6f1 + last_write_checksum: sha1:1963edb6d21f96496e04baa01a08c0da89cb2f3e + pristine_git_object: 74a2ae198246b99c0da80b0353165242542c6697 + models/operations/gettenantdestination.go: + id: e1684f9a986d + last_write_checksum: sha1:60048d8a77ac4b4c6b4223641cf073002990238f + pristine_git_object: 97400dc03d50cfb4314a6e15908fc4d3ec8f797f + models/operations/gettenantdestinationtypeschema.go: + id: 1010d0ddb8c9 + last_write_checksum: sha1:aa22f1ccd7fc6096e27be41929430b1a839fdb78 + pristine_git_object: c76fb5dae63736385e580bc99ae9a7c62aafcda1 + models/operations/gettenantevent.go: + id: 2b3c5029f56a + last_write_checksum: sha1:df848a1faff32972b4a75299ac840b224bba30b4 + pristine_git_object: b4d74ef3d4d44db8d1c5f09f43a9e4fbd93bdf5f + models/operations/gettenanteventbydestination.go: + id: 2e9009e8f449 + last_write_checksum: sha1:b21bbbdb607e077433ff4f471f6f4b5f6ef493c4 + pristine_git_object: 6bea3a71ab6c9149a3824b844d87073d85b63ca0 + models/operations/gettenantportalurl.go: + id: 5430be50389e + last_write_checksum: sha1:1f6eb381e5175c25d3c86e8d34fa672cc11035ec + pristine_git_object: 276dfb75734cf9c891d91a2608a90c6bed08ad92 + models/operations/gettenanttoken.go: + id: 12a15526bc43 + last_write_checksum: sha1:fa3b339aba273337098b7097801170de9e71f67a + pristine_git_object: 6a2ca8b89dc2bed6a1356587e9d136c081078f6a + models/operations/healthcheck.go: + id: 74c0c8ec32af + last_write_checksum: sha1:7f8bad1b4594bfedbbc6b005ea4e64d9fda6127a + pristine_git_object: 0dd35327c5d50f6989eb6efc122bbc494a2321fe + models/operations/listdestinationtypeschemasjwt.go: + id: b3f0e11a56a7 + last_write_checksum: sha1:2b91ebe037136c5a78ae3d7f3d216b3987dd31ad + pristine_git_object: cc91b0022a2c3d92cb6d85bb81854d42e9b8bf18 + models/operations/listtenantdestinations.go: + id: ce62042d8804 + last_write_checksum: sha1:9b0322d9242cc47db51e2c1ac9e9a757b649e697 + pristine_git_object: d20a8708a51cd30a4fd26f0b48402b4a1518f4a6 + models/operations/listtenantdestinationtypeschemas.go: + id: 60c96678c7d8 + last_write_checksum: sha1:4cccf5f3b45d6fcd3fc912ffbbf750f55f940eb9 + pristine_git_object: 731c2c3cdd433ed1f549b962aee93b232513fc3d + models/operations/listtenanteventdeliveries.go: + id: c563d8764e0a + last_write_checksum: sha1:ea92c282b77b10b153f3d65689c66097f940f95a + pristine_git_object: da3142762db8f3f580ac96d62755bbc421f46e22 + models/operations/listtenantevents.go: + id: b47c5316331a + last_write_checksum: sha1:8ab84babef1d1f441039597d25b418f9a7f2cf55 + pristine_git_object: 9537c52d3c9ecc39d4c04349ab884af0f07c1c7e + models/operations/listtenanteventsbydestination.go: + id: 490fbee57544 + last_write_checksum: sha1:1eb22bd31162d5f16bc493c56b0fca2fa4630e9c + pristine_git_object: 54748211b8de5beadb51caa139eca88daa7c17ef + models/operations/listtenants.go: + id: 1d503b0f52be + last_write_checksum: sha1:60f820282697bfa9d2c418a1e6d78025b6ae5371 + pristine_git_object: 9bc74ddbea79868a458425a0cd4ae30c9d847b7a + models/operations/listtenanttopics.go: + id: f23997d6bd23 + last_write_checksum: sha1:e42d38fdf902b60c058b1c22b3ecf02ca7fe5804 + pristine_git_object: 105b933479600195b39a3894ecfa9b3ecb26470e + models/operations/listtopics.go: + id: 512c7390c9df + last_write_checksum: sha1:9386b5f1d2bd1b456f33b0c279f38d75a10d9d1f + pristine_git_object: ba342db43a81db02cad6e33bc48121cf600359e7 + models/operations/options.go: + id: d20dd4db9865 + last_write_checksum: sha1:f988bfeb0d3d4910b36499849c596d2b3e16314c + pristine_git_object: 2725f344831ac355851f98cae58fdca2016745e2 + models/operations/publishevent.go: + id: 23987254790c + last_write_checksum: sha1:1ee88dbb3f385e94c55be34b29bb38ba8489f876 + pristine_git_object: 87bab24477dc31771ef66bb59b5b63dc8a7f76c4 + models/operations/retrytenantevent.go: + id: 68f253a95f41 + last_write_checksum: sha1:efe9cbf9c99c56484c534adeb5e3c9c7cc30b8d5 + pristine_git_object: a693ac287e4a3cb51b3cf8ff539b96076f822948 + models/operations/updatetenantdestination.go: + id: 3edf01e2b712 + last_write_checksum: sha1:c2ffd492002cfc2ec441982ede6437231d36e612 + pristine_git_object: 3e789faa0b21707b5288f2fe689970f01dd1fc70 + models/operations/upserttenant.go: + id: 309f717443f9 + last_write_checksum: sha1:b97a5d9f5fb41968cc8f358c3e341e2eb2812f26 + pristine_git_object: 99ed7da29b1fcd9ddf56e2aee9ba6306f0976185 + optionalnullable/optionalnullable.go: + id: ce60f259ead3 + last_write_checksum: sha1:d6aff1a420c31e025ea21d46cf056e305ae76fe8 + pristine_git_object: c6739be0619b6726565e0f11855ffe44b0e5607e + optionalnullable/optionalnullable_test.go: + id: ad67101ebca3 + last_write_checksum: sha1:2e9433eff1651ac77d6678ea76880d9a4980cbc2 + pristine_git_object: e6e5a01c6e721e879e24a38a1f97e3e27d4686d4 + outpost.go: + id: 7aebc57e3f81 + last_write_checksum: sha1:9df00493102717a8630b2560b2626513db750f72 + pristine_git_object: 8ebcbb64f0e3cbcdf9bd360374786f953990036e + publish.go: + id: b4cd78c909e0 + last_write_checksum: sha1:c7f08f05b5fa72f932b9d0e92952185cc67ea44c + pristine_git_object: 1078c29c9ea9595091d5853984b5350ace119e38 + retry/config.go: + id: 82d673cb0389 + last_write_checksum: sha1:f565273be789ffe0e3c160de1ac72a63cfe67fbe + pristine_git_object: aa809fccb3445b1e2530a979dad620512f50e70f + schemas.go: + id: 5a2cc530e9a9 + last_write_checksum: sha1:0fc95ec4dd369bd3ca29ff86cf03c4f7fb21efee + pristine_git_object: 46854eeb80c8282f592fd9077ae276056bd4d58e + tenants.go: + id: 391d6dd7cdcc + last_write_checksum: sha1:c5a04e037a513968db57f9c157c7b25606fedfd4 + pristine_git_object: c1e50033300ba36938c45f1d78a1a6c2b59d4f71 + topics.go: + id: 75500a830fc2 + last_write_checksum: sha1:c758f7fc1088b244baeb9c6dfbcab4cadef579c2 + pristine_git_object: 361710ab6ff9fd9b5e96496d272e8141382129a6 + types/bigint.go: + id: 6f911e1a03c3 + last_write_checksum: sha1:49b004005d0461fb04b846eca062b070b0360b31 + pristine_git_object: 9c6a086d51595888a6ff787ebcb8693559afee95 + types/date.go: + id: 231a623ce1b7 + last_write_checksum: sha1:3036a2e1ed15a1d484c093367eba000c38f384d0 + pristine_git_object: 5b2782f219efe6bfbce46fc2dec68998eb759438 + types/datetime.go: + id: 5023aac30a47 + last_write_checksum: sha1:196d050af6450669214e9ae4fd28e56263ae2b5d + pristine_git_object: 3eff332daa04e34cec5ffb10add670bafd8ac454 + types/pointers.go: + id: 6d0d0a6cb6f3 + last_write_checksum: sha1:fc2275ea006257ba9ba4ff6f2a2cdb6205371eef + pristine_git_object: 35c439d2661e08fcb6a854096fd7b9a8561b3938 examples: healthCheck: speakeasy-default-health-check: responses: "200": text/plain: "" + application/json: {"status": "healthy", "timestamp": "2025-11-11T10:30:00Z", "workers": {"key": {"status": "healthy"}}} "404": application/json: {} "401": @@ -345,6 +1326,13 @@ examples: responses: "200": application/json: {"id": "tenant_123", "destinations_count": 5, "topics": ["user.created", "user.deleted"], "created_at": "2024-01-01T00:00:00Z"} + speakeasy-default-upsert-tenant: + parameters: + path: + tenant_id: "" + responses: + "200": + application/json: {"id": "123", "destinations_count": 5, "topics": ["user.created", "user.deleted"], "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z"} getTenant: TenantExample: parameters: @@ -353,6 +1341,13 @@ examples: responses: "200": application/json: {"id": "tenant_123", "destinations_count": 5, "topics": ["user.created", "user.deleted"], "created_at": "2024-01-01T00:00:00Z"} + speakeasy-default-get-tenant: + parameters: + path: + tenant_id: "" + responses: + "200": + application/json: {"id": "123", "destinations_count": 5, "topics": ["user.created", "user.deleted"], "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z"} deleteTenant: SuccessExample: parameters: @@ -369,7 +1364,7 @@ examples: query: {} responses: "200": - application/json: {"redirect_url": "https://webhooks.acme.com/?token=JWT_TOKEN"} + application/json: {"redirect_url": "https://webhooks.acme.com/?token=JWT_TOKEN&tenant_id=tenant_123", "tenant_id": "tenant_123"} getTenantToken: TenantTokenExample: parameters: @@ -377,16 +1372,17 @@ examples: tenant_id: "" responses: "200": - application/json: {"token": "SOME_JWT_TOKEN"} + application/json: {"token": "SOME_JWT_TOKEN", "tenant_id": "tenant_123"} listTenantDestinations: DestinationsListExample: parameters: path: tenant_id: "" - query: {} + query: + type: "webhook" responses: "200": - application/json: [{"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}}, {"id": "des_sqs_456", "type": "aws_sqs", "topics": ["*"], "disabled_at": "2024-03-01T12:00:00Z", "created_at": "2024-02-20T11:30:00Z", "config": {"endpoint": "https://sqs.us-west-2.amazonaws.com", "queue_url": "https://sqs.us-west-2.amazonaws.com/123456789012/my-app-queue"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}, {"id": "des_s3_789", "type": "aws_s3", "topics": ["*"], "disabled_at": null, "created_at": "2024-03-20T12:00:00Z", "config": {"bucket": "my-bucket", "region": "us-east-1"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}] + application/json: [{"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "updated_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}}, {"id": "des_sqs_456", "type": "aws_sqs", "topics": ["*"], "disabled_at": "2024-03-01T12:00:00Z", "created_at": "2024-02-20T11:30:00Z", "updated_at": "2024-02-20T11:30:00Z", "config": {"endpoint": "https://sqs.us-west-2.amazonaws.com", "queue_url": "https://sqs.us-west-2.amazonaws.com/123456789012/my-app-queue"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}, {"id": "des_s3_789", "type": "aws_s3", "topics": ["*"], "disabled_at": null, "created_at": "2024-03-20T12:00:00Z", "updated_at": "2024-03-20T12:00:00Z", "config": {"bucket": "my-bucket", "region": "us-east-1"}, "credentials": {"key": "AKIAIOSFODNN7EXAMPLE", "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}] createTenantDestination: WebhookCreatedExample: parameters: @@ -396,7 +1392,7 @@ examples: application/json: {"id": "user-provided-id", "type": "rabbitmq", "topics": "*", "config": {"server_url": "localhost:5672", "exchange": "my-exchange", "tls": "false"}, "credentials": {"username": "guest", "password": "guest"}} responses: "201": - application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456"}} + application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "updated_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456"}} getTenantDestination: WebhookGetExample: parameters: @@ -405,7 +1401,7 @@ examples: destination_id: "" responses: "200": - application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} + application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "updated_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} updateTenantDestination: DestinationUpdatedExample: parameters: @@ -416,7 +1412,7 @@ examples: application/json: {"topics": "*", "config": {"server_url": "localhost:5672", "exchange": "my-exchange", "tls": "false"}, "credentials": {"username": "guest", "password": "guest"}} responses: "200": - application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/new-handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} + application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "updated_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/new-handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} deleteTenantDestination: SuccessExample: parameters: @@ -434,7 +1430,7 @@ examples: destination_id: "" responses: "200": - application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} + application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": null, "created_at": "2024-02-15T10:00:00Z", "updated_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} disableTenantDestination: WebhookDisabledExample: parameters: @@ -443,7 +1439,7 @@ examples: destination_id: "" responses: "200": - application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": "2024-04-11T21:00:00Z", "created_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} + application/json: {"id": "des_webhook_123", "type": "webhook", "topics": ["user.created", "order.shipped"], "disabled_at": "2024-04-11T21:00:00Z", "created_at": "2024-02-15T10:00:00Z", "updated_at": "2024-02-15T10:00:00Z", "config": {"url": "https://my-service.com/webhook/handler"}, "credentials": {"secret": "whsec_abc123def456", "previous_secret": "whsec_prev789xyz012", "previous_secret_invalid_at": "2024-02-16T10:00:00Z"}} publishEvent: speakeasy-default-publish-event: requestBody: @@ -470,7 +1466,7 @@ examples: "511": application/json: {} "202": - application/json: {"id": "evt_abc123xyz789"} + application/json: {"id": "evt_abc123xyz789", "duplicate": false} listTenantDestinationTypeSchemas: DestinationTypesExample: parameters: @@ -589,6 +1585,300 @@ examples: application/json: {} "511": application/json: {} + listTenants: + speakeasy-default-list-tenants: + parameters: + query: + limit: 20 + order: "desc" + responses: + "200": + application/json: {"data": [{"id": "123", "destinations_count": 5, "topics": ["user.created", "user.deleted"], "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z"}], "next": "MTcwNDA2NzIwMA==", "prev": null, "count": 42} + "400": + application/json: {"error": "invalid cursor format"} + "501": + application/json: {"error": "list tenant not supported"} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Go SDK Changes Detected:\n* `Outpost.Events.List()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `Outpost.Events.ListByDestination()`: \n * `request` **Changed** **Breaking** :warning:\n * `response` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.List()`: \n * `request.Type` **Changed**\n * `response.[].[awsS3]` **Added**\n* `Outpost.Destinations.Create()`: \n * `request.DestinationCreate.[awsS3]` **Added**\n * `response.[awsS3]` **Added**\n* `Outpost.Destinations.Get()`: `response.[awsS3]` **Added**\n* `Outpost.Destinations.Update()`: \n * `request.DestinationUpdate.[destinationUpdateAwss3]` **Added**\n * `response.[destination].[awsS3]` **Added**\n* `Outpost.Destinations.Enable()`: `response.[awsS3]` **Added**\n* `Outpost.Destinations.Disable()`: `response.[awsS3]` **Added**\n* `Outpost.Schemas.Get()`: `request.Type` **Changed**\n* `Outpost.Schemas.GetDestinationTypeJwt()`: `request.Type` **Changed**\n" +releaseNotes: "## Go SDK Changes:\n* `Outpost.Destinations.Enable()`: \n * `response` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Tenants.GetToken()`: \n * `response.TenantId` **Added**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Tenants.Upsert()`: \n * `request.Params` **Added**\n * `response` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Tenants.Get()`: \n * `response` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Tenants.Delete()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Tenants.GetPortalUrl()`: \n * `response.TenantId` **Added**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.Delete()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.List()`: \n * `request.Type` **Changed** **Breaking** :warning:\n * `response.[]` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.Create()`: \n * `request.Params` **Changed**\n * `response` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.Get()`: \n * `response` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Health.Check()`: `response.status[200]` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.Update()`: \n * `request.Params` **Changed**\n * `response.[destination]` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Schemas.Get()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Destinations.Disable()`: \n * `response` **Changed**\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Events.Retry()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Schemas.ListTenantDestinationTypes()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Events.GetByDestination()`: \n * `response` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Topics.List()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Events.List()`: \n * `response` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Events.Get()`: \n * `response` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Events.ListDeliveries()`: `error` **Changed** **Breaking** :warning:\n* `Outpost.Events.ListByDestination()`: \n * `response` **Changed** **Breaking** :warning:\n * `error` **Changed** **Breaking** :warning:\n* `Outpost.Tenants.ListTenants()`: **Added**\n* `Outpost.Publish.Event()`: `response.Duplicate` **Added**\n" +generatedFiles: + - .gitattributes + - /models/apierrors/badrequesterror.go + - /models/apierrors/internalservererror.go + - /models/apierrors/notfounderror.go + - /models/apierrors/ratelimitederror.go + - /models/apierrors/timeouterror.go + - /models/apierrors/unauthorizederror.go + - /models/components/awskinesisconfig.go + - /models/components/awskinesiscredentials.go + - /models/components/awss3config.go + - /models/components/awss3credentials.go + - /models/components/awssqsconfig.go + - /models/components/awssqscredentials.go + - /models/components/azureservicebusconfig.go + - /models/components/azureservicebuscredentials.go + - /models/components/deliveryattempt.go + - /models/components/destination.go + - /models/components/destinationawskinesis.go + - /models/components/destinationawss3.go + - /models/components/destinationawssqs.go + - /models/components/destinationazureservicebus.go + - /models/components/destinationcreate.go + - /models/components/destinationcreateawskinesis.go + - /models/components/destinationcreateawss3.go + - /models/components/destinationcreateawssqs.go + - /models/components/destinationcreateazureservicebus.go + - /models/components/destinationcreatehookdeck.go + - /models/components/destinationcreaterabbitmq.go + - /models/components/destinationcreatewebhook.go + - /models/components/destinationhookdeck.go + - /models/components/destinationrabbitmq.go + - /models/components/destinationschemafield.go + - /models/components/destinationtypeschema.go + - /models/components/destinationupdate.go + - /models/components/destinationupdateawskinesis.go + - /models/components/destinationupdateawss3.go + - /models/components/destinationupdateawssqs.go + - /models/components/destinationupdatehookdeck.go + - /models/components/destinationupdaterabbitmq.go + - /models/components/destinationupdatewebhook.go + - /models/components/destinationwebhook.go + - /models/components/event.go + - /models/components/hookdeckcredentials.go + - /models/components/httpmetadata.go + - /models/components/portalredirect.go + - /models/components/publishrequest.go + - /models/components/publishresponse.go + - /models/components/rabbitmqconfig.go + - /models/components/rabbitmqcredentials.go + - /models/components/security.go + - /models/components/successresponse.go + - /models/components/tenant.go + - /models/components/tenanttoken.go + - /models/components/topics.go + - /models/components/webhookconfig.go + - /models/components/webhookcredentials.go + - /models/components/webhookcredentialsupdate.go + - /models/operations/createtenantdestination.go + - /models/operations/deletetenant.go + - /models/operations/deletetenantdestination.go + - /models/operations/disabletenantdestination.go + - /models/operations/enabletenantdestination.go + - /models/operations/getdestinationtypeschema.go + - /models/operations/gettenant.go + - /models/operations/gettenantdestination.go + - /models/operations/gettenantdestinationtypeschema.go + - /models/operations/gettenantevent.go + - /models/operations/gettenanteventbydestination.go + - /models/operations/gettenantportalurl.go + - /models/operations/gettenanttoken.go + - /models/operations/healthcheck.go + - /models/operations/listdestinationtypeschemasjwt.go + - /models/operations/listtenantdestinations.go + - /models/operations/listtenantdestinationtypeschemas.go + - /models/operations/listtenanteventdeliveries.go + - /models/operations/listtenantevents.go + - /models/operations/listtenanteventsbydestination.go + - /models/operations/listtenanttopics.go + - /models/operations/listtopics.go + - /models/operations/publishevent.go + - /models/operations/retrytenantevent.go + - /models/operations/updatetenantdestination.go + - /models/operations/upserttenant.go + - USAGE.md + - destinations.go + - docs/models/apierrors/badrequesterror.md + - docs/models/apierrors/internalservererror.md + - docs/models/apierrors/notfounderror.md + - docs/models/apierrors/ratelimitederror.md + - docs/models/apierrors/timeouterror.md + - docs/models/apierrors/unauthorizederror.md + - docs/models/components/awskinesisconfig.md + - docs/models/components/awskinesiscredentials.md + - docs/models/components/awss3config.md + - docs/models/components/awss3credentials.md + - docs/models/components/awssqsconfig.md + - docs/models/components/awssqscredentials.md + - docs/models/components/azureservicebusconfig.md + - docs/models/components/azureservicebuscredentials.md + - docs/models/components/deliveryattempt.md + - docs/models/components/destination.md + - docs/models/components/destinationawskinesis.md + - docs/models/components/destinationawskinesistype.md + - docs/models/components/destinationawss3.md + - docs/models/components/destinationawss3type.md + - docs/models/components/destinationawssqs.md + - docs/models/components/destinationawssqstype.md + - docs/models/components/destinationazureservicebus.md + - docs/models/components/destinationazureservicebustype.md + - docs/models/components/destinationcreate.md + - docs/models/components/destinationcreateawskinesis.md + - docs/models/components/destinationcreateawskinesistype.md + - docs/models/components/destinationcreateawss3.md + - docs/models/components/destinationcreateawss3type.md + - docs/models/components/destinationcreateawssqs.md + - docs/models/components/destinationcreateawssqstype.md + - docs/models/components/destinationcreateazureservicebus.md + - docs/models/components/destinationcreateazureservicebustype.md + - docs/models/components/destinationcreatehookdeck.md + - docs/models/components/destinationcreatehookdecktype.md + - docs/models/components/destinationcreaterabbitmq.md + - docs/models/components/destinationcreaterabbitmqtype.md + - docs/models/components/destinationcreatewebhook.md + - docs/models/components/destinationcreatewebhooktype.md + - docs/models/components/destinationhookdeck.md + - docs/models/components/destinationhookdecktype.md + - docs/models/components/destinationrabbitmq.md + - docs/models/components/destinationrabbitmqtype.md + - docs/models/components/destinationschemafield.md + - docs/models/components/destinationschemafieldtype.md + - docs/models/components/destinationtypeschema.md + - docs/models/components/destinationupdate.md + - docs/models/components/destinationupdateawskinesis.md + - docs/models/components/destinationupdateawss3.md + - docs/models/components/destinationupdateawssqs.md + - docs/models/components/destinationupdatehookdeck.md + - docs/models/components/destinationupdaterabbitmq.md + - docs/models/components/destinationupdatewebhook.md + - docs/models/components/destinationwebhook.md + - docs/models/components/destinationwebhooktype.md + - docs/models/components/event.md + - docs/models/components/hookdeckcredentials.md + - docs/models/components/httpmetadata.md + - docs/models/components/portalredirect.md + - docs/models/components/publishrequest.md + - docs/models/components/publishresponse.md + - docs/models/components/rabbitmqconfig.md + - docs/models/components/rabbitmqcredentials.md + - docs/models/components/security.md + - docs/models/components/status.md + - docs/models/components/successresponse.md + - docs/models/components/tenant.md + - docs/models/components/tenanttoken.md + - docs/models/components/tls.md + - docs/models/components/topics.md + - docs/models/components/topicsenum.md + - docs/models/components/webhookconfig.md + - docs/models/components/webhookcredentials.md + - docs/models/components/webhookcredentialsupdate.md + - docs/models/operations/createtenantdestinationglobals.md + - docs/models/operations/createtenantdestinationrequest.md + - docs/models/operations/createtenantdestinationresponse.md + - docs/models/operations/deletetenantdestinationglobals.md + - docs/models/operations/deletetenantdestinationrequest.md + - docs/models/operations/deletetenantdestinationresponse.md + - docs/models/operations/deletetenantglobals.md + - docs/models/operations/deletetenantrequest.md + - docs/models/operations/deletetenantresponse.md + - docs/models/operations/destinationid.md + - docs/models/operations/disabletenantdestinationglobals.md + - docs/models/operations/disabletenantdestinationrequest.md + - docs/models/operations/disabletenantdestinationresponse.md + - docs/models/operations/enabletenantdestinationglobals.md + - docs/models/operations/enabletenantdestinationrequest.md + - docs/models/operations/enabletenantdestinationresponse.md + - docs/models/operations/getdestinationtypeschemarequest.md + - docs/models/operations/getdestinationtypeschemaresponse.md + - docs/models/operations/getdestinationtypeschematype.md + - docs/models/operations/gettenantdestinationglobals.md + - docs/models/operations/gettenantdestinationrequest.md + - docs/models/operations/gettenantdestinationresponse.md + - docs/models/operations/gettenantdestinationtypeschemaglobals.md + - docs/models/operations/gettenantdestinationtypeschemarequest.md + - docs/models/operations/gettenantdestinationtypeschemaresponse.md + - docs/models/operations/gettenantdestinationtypeschematype.md + - docs/models/operations/gettenanteventbydestinationglobals.md + - docs/models/operations/gettenanteventbydestinationrequest.md + - docs/models/operations/gettenanteventbydestinationresponse.md + - docs/models/operations/gettenanteventglobals.md + - docs/models/operations/gettenanteventrequest.md + - docs/models/operations/gettenanteventresponse.md + - docs/models/operations/gettenantglobals.md + - docs/models/operations/gettenantportalurlglobals.md + - docs/models/operations/gettenantportalurlrequest.md + - docs/models/operations/gettenantportalurlresponse.md + - docs/models/operations/gettenantrequest.md + - docs/models/operations/gettenantresponse.md + - docs/models/operations/gettenanttokenglobals.md + - docs/models/operations/gettenanttokenrequest.md + - docs/models/operations/gettenanttokenresponse.md + - docs/models/operations/healthcheckresponse.md + - docs/models/operations/listdestinationtypeschemasjwtresponse.md + - docs/models/operations/listtenantdestinationsglobals.md + - docs/models/operations/listtenantdestinationsrequest.md + - docs/models/operations/listtenantdestinationsresponse.md + - docs/models/operations/listtenantdestinationstypeenum1.md + - docs/models/operations/listtenantdestinationstypeenum2.md + - docs/models/operations/listtenantdestinationtypeschemasglobals.md + - docs/models/operations/listtenantdestinationtypeschemasrequest.md + - docs/models/operations/listtenantdestinationtypeschemasresponse.md + - docs/models/operations/listtenanteventdeliveriesglobals.md + - docs/models/operations/listtenanteventdeliveriesrequest.md + - docs/models/operations/listtenanteventdeliveriesresponse.md + - docs/models/operations/listtenanteventsbydestinationglobals.md + - docs/models/operations/listtenanteventsbydestinationrequest.md + - docs/models/operations/listtenanteventsbydestinationresponse.md + - docs/models/operations/listtenanteventsbydestinationresponsebody.md + - docs/models/operations/listtenanteventsbydestinationstatus.md + - docs/models/operations/listtenanteventsglobals.md + - docs/models/operations/listtenanteventsrequest.md + - docs/models/operations/listtenanteventsresponse.md + - docs/models/operations/listtenanteventsresponsebody.md + - docs/models/operations/listtenanteventsstatus.md + - docs/models/operations/listtenanttopicsglobals.md + - docs/models/operations/listtenanttopicsrequest.md + - docs/models/operations/listtenanttopicsresponse.md + - docs/models/operations/listtopicsresponse.md + - docs/models/operations/option.md + - docs/models/operations/publisheventresponse.md + - docs/models/operations/retrytenanteventglobals.md + - docs/models/operations/retrytenanteventrequest.md + - docs/models/operations/retrytenanteventresponse.md + - docs/models/operations/theme.md + - docs/models/operations/topics.md + - docs/models/operations/type.md + - docs/models/operations/updatetenantdestinationglobals.md + - docs/models/operations/updatetenantdestinationrequest.md + - docs/models/operations/updatetenantdestinationresponse.md + - docs/models/operations/updatetenantdestinationresponsebody.md + - docs/models/operations/upserttenantglobals.md + - docs/models/operations/upserttenantrequest.md + - docs/models/operations/upserttenantresponse.md + - docs/sdks/destinations/README.md + - docs/sdks/events/README.md + - docs/sdks/health/README.md + - docs/sdks/outpost/README.md + - docs/sdks/publish/README.md + - docs/sdks/schemas/README.md + - docs/sdks/tenants/README.md + - docs/sdks/topics/README.md + - events.go + - go.mod + - health.go + - internal/config/sdkconfiguration.go + - internal/globals/globals.go + - internal/hooks/hooks.go + - internal/utils/contenttype.go + - internal/utils/env.go + - internal/utils/form.go + - internal/utils/headers.go + - internal/utils/json.go + - internal/utils/pathparams.go + - internal/utils/queryparams.go + - internal/utils/requestbody.go + - internal/utils/retries.go + - internal/utils/security.go + - internal/utils/utils.go + - models/apierrors/apierror.go + - models/operations/options.go + - outpost.go + - publish.go + - retry/config.go + - schemas.go + - tenants.go + - topics.go + - types/bigint.go + - types/date.go + - types/datetime.go + - types/decimal.go + - types/pointers.go diff --git a/sdks/outpost-go/.speakeasy/gen.yaml b/sdks/outpost-go/.speakeasy/gen.yaml index 61874e719..58ce4bc27 100644 --- a/sdks/outpost-go/.speakeasy/gen.yaml +++ b/sdks/outpost-go/.speakeasy/gen.yaml @@ -27,7 +27,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false go: - version: 0.6.0 + version: 0.5.0 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false baseErrorName: OutpostError diff --git a/sdks/outpost-go/README.md b/sdks/outpost-go/README.md index dbedaefb5..a6d4e6ad7 100644 --- a/sdks/outpost-go/README.md +++ b/sdks/outpost-go/README.md @@ -66,7 +66,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } @@ -102,7 +102,7 @@ func main() { s := outpostgo.New( outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -110,7 +110,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } @@ -147,7 +147,6 @@ func main() { * [Check](docs/sdks/health/README.md#check) - Health Check - ### [Publish](docs/sdks/publish/README.md) * [Event](docs/sdks/publish/README.md#event) - Publish Event @@ -161,6 +160,7 @@ func main() { ### [Tenants](docs/sdks/tenants/README.md) +* [ListTenants](docs/sdks/tenants/README.md#listtenants) - List Tenants * [Upsert](docs/sdks/tenants/README.md#upsert) - Create or Update Tenant * [Get](docs/sdks/tenants/README.md#get) - Get Tenant * [Delete](docs/sdks/tenants/README.md#delete) - Delete Tenant @@ -209,11 +209,11 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) - res, err := s.Tenants.Upsert(ctx) + res, err := s.Tenants.Upsert(ctx, nil) if err != nil { log.Fatal(err) } @@ -261,7 +261,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } @@ -300,7 +300,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } @@ -449,7 +449,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } diff --git a/sdks/outpost-go/RELEASES.md b/sdks/outpost-go/RELEASES.md index 757261550..3948649bd 100644 --- a/sdks/outpost-go/RELEASES.md +++ b/sdks/outpost-go/RELEASES.md @@ -58,4 +58,14 @@ Based on: ### Generated - [go v0.4.0] sdks/outpost-go ### Releases -- [Go v0.4.0] https://github.com/hookdeck/outpost/releases/tag/sdks/outpost-go/v0.4.0 - sdks/outpost-go \ No newline at end of file +- [Go v0.4.0] https://github.com/hookdeck/outpost/releases/tag/sdks/outpost-go/v0.4.0 - sdks/outpost-go + +## 2026-01-16 09:43:41 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.686.0 (2.796.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.5.0] sdks/outpost-go +### Releases +- [Go v0.5.0] https://github.com/hookdeck/outpost/releases/tag/sdks/outpost-go/v0.5.0 - sdks/outpost-go \ No newline at end of file diff --git a/sdks/outpost-go/USAGE.md b/sdks/outpost-go/USAGE.md index ec297f54a..302b1c495 100644 --- a/sdks/outpost-go/USAGE.md +++ b/sdks/outpost-go/USAGE.md @@ -17,7 +17,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } diff --git a/sdks/outpost-go/destinations.go b/sdks/outpost-go/destinations.go index 28e880d2b..23250994e 100644 --- a/sdks/outpost-go/destinations.go +++ b/sdks/outpost-go/destinations.go @@ -57,7 +57,7 @@ func newDestinations(rootSDK *Outpost, sdkConfig config.SDKConfiguration, hooks // List Destinations // Return a list of the destinations for the tenant. The endpoint is not paged. -func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operations.Type, topics *operations.Topics, opts ...operations.Option) (*operations.ListTenantDestinationsResponse, error) { +func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operations.ListTenantDestinationsType, topics *operations.Topics, opts ...operations.Option) (*operations.ListTenantDestinationsResponse, error) { request := operations.ListTenantDestinationsRequest{ TenantID: tenantID, Type: type_, @@ -86,7 +86,7 @@ func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operat } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -97,7 +97,7 @@ func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operat BaseURL: baseURL, Context: ctx, OperationID: "listTenantDestinations", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -119,7 +119,7 @@ func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operat req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + if err := utils.PopulateQueryParams(ctx, req, request, globals, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -207,7 +207,7 @@ func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operat _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -251,221 +251,6 @@ func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operat } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -494,10 +279,10 @@ func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operat // Create Destination // Creates a new destination for the tenant. The request body structure depends on the `type`. -func (s *Destinations) Create(ctx context.Context, destinationCreate components.DestinationCreate, tenantID *string, opts ...operations.Option) (*operations.CreateTenantDestinationResponse, error) { +func (s *Destinations) Create(ctx context.Context, params components.DestinationCreate, tenantID *string, opts ...operations.Option) (*operations.CreateTenantDestinationResponse, error) { request := operations.CreateTenantDestinationRequest{ - TenantID: tenantID, - DestinationCreate: destinationCreate, + TenantID: tenantID, + Params: params, } globals := operations.CreateTenantDestinationGlobals{ @@ -522,7 +307,7 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -533,10 +318,10 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. BaseURL: baseURL, Context: ctx, OperationID: "createTenantDestination", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "DestinationCreate", "json", `request:"mediaType=application/json"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Params", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err } @@ -646,7 +431,7 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -690,199 +475,205 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: + case httpRes.StatusCode == 400: fallthrough - case httpRes.StatusCode == 403: + case httpRes.StatusCode == 404: fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + return res, nil - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } +} - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } +// Get Destination +// Retrieves details for a specific destination. +func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantDestinationResponse, error) { + request := operations.GetTenantDestinationRequest{ + TenantID: tenantID, + DestinationID: destinationID, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + globals := operations.GetTenantDestinationGlobals{ + TenantID: s.sdkConfiguration.Globals.TenantID, + } - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) } - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getTenantDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err + if err != nil { + return nil, err + } + + req.Body = copyBody } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) if err != nil { - return nil, err + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) } - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) } + return httpRes, err + }) - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { if err != nil { - return nil, err + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.GetTenantDestinationResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -890,12 +681,12 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. return nil, err } - var out apierrors.UnauthorizedError + var out components.Destination if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.Destination = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -903,8 +694,6 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 400: - fallthrough case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -931,15 +720,16 @@ func (s *Destinations) Create(ctx context.Context, destinationCreate components. } -// Get Destination -// Retrieves details for a specific destination. -func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantDestinationResponse, error) { - request := operations.GetTenantDestinationRequest{ +// Update Destination +// Updates the configuration of an existing destination. The request body structure depends on the destination's `type`. Type itself cannot be updated. May return an OAuth redirect URL for certain types. +func (s *Destinations) Update(ctx context.Context, destinationID string, params components.DestinationUpdate, tenantID *string, opts ...operations.Option) (*operations.UpdateTenantDestinationResponse, error) { + request := operations.UpdateTenantDestinationRequest{ TenantID: tenantID, DestinationID: destinationID, + Params: params, } - globals := operations.GetTenantDestinationGlobals{ + globals := operations.UpdateTenantDestinationGlobals{ TenantID: s.sdkConfiguration.Globals.TenantID, } @@ -961,7 +751,7 @@ func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID * } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -971,10 +761,14 @@ func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID * SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getTenantDestination", - OAuth2Scopes: []string{}, + OperationID: "updateTenantDestination", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Params", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } timeout := o.Timeout if timeout == nil { @@ -987,12 +781,15 @@ func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID * defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -1072,1123 +869,36 @@ func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID * if err != nil || httpRes == nil { if err != nil { err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTenantDestinationResponse{ - HTTPMeta: components.HTTPMetadata{ - Request: req, - Response: httpRes, - }, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out components.Destination - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Destination = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// Update Destination -// Updates the configuration of an existing destination. The request body structure depends on the destination's `type`. Type itself cannot be updated. May return an OAuth redirect URL for certain types. -func (s *Destinations) Update(ctx context.Context, destinationID string, destinationUpdate components.DestinationUpdate, tenantID *string, opts ...operations.Option) (*operations.UpdateTenantDestinationResponse, error) { - request := operations.UpdateTenantDestinationRequest{ - TenantID: tenantID, - DestinationID: destinationID, - DestinationUpdate: destinationUpdate, - } - - globals := operations.UpdateTenantDestinationGlobals{ - TenantID: s.sdkConfiguration.Globals.TenantID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}", request, globals) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "updateTenantDestination", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "DestinationUpdate", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "application/json") - req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if reqContentType != "" { - req.Header.Set("Content-Type", reqContentType) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.UpdateTenantDestinationResponse{ - HTTPMeta: components.HTTPMetadata{ - Request: req, - Response: httpRes, - }, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.UpdateTenantDestinationResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.OneOf = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// Delete Destination -// Deletes a specific destination. -func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.DeleteTenantDestinationResponse, error) { - request := operations.DeleteTenantDestinationRequest{ - TenantID: tenantID, - DestinationID: destinationID, - } - - globals := operations.DeleteTenantDestinationGlobals{ - TenantID: s.sdkConfiguration.Globals.TenantID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}", request, globals) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "deleteTenantDestination", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "application/json") - req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.DeleteTenantDestinationResponse{ - HTTPMeta: components.HTTPMetadata{ - Request: req, - Response: httpRes, - }, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out components.SuccessResponse - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.SuccessResponse = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err + } else { + err = fmt.Errorf("error sending request: no response") } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.UpdateTenantDestinationResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -2196,12 +906,12 @@ func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantI return nil, err } - var out apierrors.UnauthorizedError + var out operations.UpdateTenantDestinationResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.OneOf = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2209,6 +919,8 @@ func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantI } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } + case httpRes.StatusCode == 400: + fallthrough case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -2235,15 +947,15 @@ func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantI } -// Enable Destination -// Enables a previously disabled destination. -func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.EnableTenantDestinationResponse, error) { - request := operations.EnableTenantDestinationRequest{ +// Delete Destination +// Deletes a specific destination. +func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.DeleteTenantDestinationResponse, error) { + request := operations.DeleteTenantDestinationRequest{ TenantID: tenantID, DestinationID: destinationID, } - globals := operations.EnableTenantDestinationGlobals{ + globals := operations.DeleteTenantDestinationGlobals{ TenantID: s.sdkConfiguration.Globals.TenantID, } @@ -2265,7 +977,7 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}/enable", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2275,8 +987,8 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "enableTenantDestination", - OAuth2Scopes: []string{}, + OperationID: "deleteTenantDestination", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -2291,7 +1003,7 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI defer cancel() } - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -2382,7 +1094,7 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2397,7 +1109,7 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI } } - res := &operations.EnableTenantDestinationResponse{ + res := &operations.DeleteTenantDestinationResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -2413,12 +1125,12 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI return nil, err } - var out components.Destination + var out components.SuccessResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Destination = &out + res.SuccessResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2426,201 +1138,203 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: + case httpRes.StatusCode == 404: fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + return res, nil - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } +} - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } +// Enable Destination +// Enables a previously disabled destination. +func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.EnableTenantDestinationResponse, error) { + request := operations.EnableTenantDestinationRequest{ + TenantID: tenantID, + DestinationID: destinationID, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + globals := operations.EnableTenantDestinationGlobals{ + TenantID: s.sdkConfiguration.Globals.TenantID, + } - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}/enable", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "enableTenantDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err + if err != nil { + return nil, err + } + + req.Body = copyBody } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) if err != nil { - return nil, err + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) } - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) } + return httpRes, err + }) - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { if err != nil { - return nil, err + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.EnableTenantDestinationResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -2628,12 +1342,12 @@ func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantI return nil, err } - var out apierrors.UnauthorizedError + var out components.Destination if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.Destination = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2697,7 +1411,7 @@ func (s *Destinations) Disable(ctx context.Context, destinationID string, tenant } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}/disable", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}/disable", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2708,7 +1422,7 @@ func (s *Destinations) Disable(ctx context.Context, destinationID string, tenant BaseURL: baseURL, Context: ctx, OperationID: "disableTenantDestination", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -2814,7 +1528,7 @@ func (s *Destinations) Disable(ctx context.Context, destinationID string, tenant _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2858,221 +1572,6 @@ func (s *Destinations) Disable(ctx context.Context, destinationID string, tenant } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: diff --git a/sdks/outpost-go/docs/models/apierrors/listtenantsbadrequesterror.md b/sdks/outpost-go/docs/models/apierrors/listtenantsbadrequesterror.md new file mode 100644 index 000000000..1cf091d3e --- /dev/null +++ b/sdks/outpost-go/docs/models/apierrors/listtenantsbadrequesterror.md @@ -0,0 +1,11 @@ +# ListTenantsBadRequestError + +Invalid request parameters (e.g., invalid cursor, both next and prev provided). + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Error` | **string* | :heavy_minus_sign: | N/A | invalid cursor format | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/apierrors/notimplementederror.md b/sdks/outpost-go/docs/models/apierrors/notimplementederror.md new file mode 100644 index 000000000..9f5d1df8f --- /dev/null +++ b/sdks/outpost-go/docs/models/apierrors/notimplementederror.md @@ -0,0 +1,11 @@ +# NotImplementedError + +List Tenants feature is not available. Requires Redis with RediSearch module. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `Error` | **string* | :heavy_minus_sign: | N/A | list tenant not supported | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/awss3config.md b/sdks/outpost-go/docs/models/components/awss3config.md index 009999559..5296ae614 100644 --- a/sdks/outpost-go/docs/models/components/awss3config.md +++ b/sdks/outpost-go/docs/models/components/awss3config.md @@ -7,5 +7,5 @@ | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | `Bucket` | *string* | :heavy_check_mark: | The name of your AWS S3 bucket. | my-bucket | | `Region` | *string* | :heavy_check_mark: | The AWS region where your bucket is located. | us-east-1 | -| `KeyTemplate` | **string* | :heavy_minus_sign: | JMESPath expression for generating S3 object keys. Default is join('', [time.rfc3339_nano, '_', metadata."event-id", '.json']). | join('/', [time.year, time.month, time.day, metadata.`"event-id"`, '.json']) | +| `KeyTemplate` | **string* | :heavy_minus_sign: | JMESPath expression for generating S3 object keys. Default is join('', [time.rfc3339_nano, '_', metadata."event-id", '.json']). | join('/', [time.year, time.month, time.day, metadata."event-id", '.json']) | | `StorageClass` | **string* | :heavy_minus_sign: | The storage class for the S3 objects (e.g., STANDARD, INTELLIGENT_TIERING, GLACIER, etc.). Defaults to "STANDARD". | STANDARD | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/deliveryattempt.md b/sdks/outpost-go/docs/models/components/deliveryattempt.md index fc79b6400..84f513984 100644 --- a/sdks/outpost-go/docs/models/components/deliveryattempt.md +++ b/sdks/outpost-go/docs/models/components/deliveryattempt.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `DeliveredAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | 2024-01-01T00:00:00Z | -| `Status` | [*components.Status](../../models/components/status.md) | :heavy_minus_sign: | N/A | success | -| `ResponseStatusCode` | **int64* | :heavy_minus_sign: | N/A | 200 | -| `ResponseBody` | **string* | :heavy_minus_sign: | N/A | {"status":"ok"} | -| `ResponseHeaders` | map[string]*string* | :heavy_minus_sign: | N/A | {
"content-type": "application/json"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `DeliveredAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | 2024-01-01T00:00:00Z | +| `Status` | [*components.DeliveryAttemptStatus](../../models/components/deliveryattemptstatus.md) | :heavy_minus_sign: | N/A | success | +| `ResponseStatusCode` | **int64* | :heavy_minus_sign: | N/A | 200 | +| `ResponseBody` | **string* | :heavy_minus_sign: | N/A | {"status":"ok"} | +| `ResponseHeaders` | map[string]*string* | :heavy_minus_sign: | N/A | {
"content-type": "application/json"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/deliveryattemptstatus.md b/sdks/outpost-go/docs/models/components/deliveryattemptstatus.md new file mode 100644 index 000000000..0a78373b1 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/deliveryattemptstatus.md @@ -0,0 +1,9 @@ +# DeliveryAttemptStatus + + +## Values + +| Name | Value | +| ------------------------------ | ------------------------------ | +| `DeliveryAttemptStatusSuccess` | success | +| `DeliveryAttemptStatusFailed` | failed | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destination.md b/sdks/outpost-go/docs/models/components/destination.md index 2371cbf69..563db6125 100644 --- a/sdks/outpost-go/docs/models/components/destination.md +++ b/sdks/outpost-go/docs/models/components/destination.md @@ -45,3 +45,9 @@ destination := components.CreateDestinationAzureServicebus(components.Destinatio destination := components.CreateDestinationAwsS3(components.DestinationAwss3{/* values here */}) ``` +### DestinationGCPPubSub + +```go +destination := components.CreateDestinationGcpPubsub(components.DestinationGCPPubSub{/* values here */}) +``` + diff --git a/sdks/outpost-go/docs/models/components/destinationawskinesis.md b/sdks/outpost-go/docs/models/components/destinationawskinesis.md index 4ca67e4cc..52a279bd7 100644 --- a/sdks/outpost-go/docs/models/components/destinationawskinesis.md +++ b/sdks/outpost-go/docs/models/components/destinationawskinesis.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationAWSKinesisType](../../models/components/destinationawskinesistype.md) | :heavy_check_mark: | Type of the destination. | aws_kinesis | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | [components.AWSKinesisConfig](../../models/components/awskinesisconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.AWSKinesisCredentials](../../models/components/awskinesiscredentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (Kinesis stream name). Read-only. | production-events | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the stream). Read-only. | https://eu-west-1.console.aws.amazon.com/kinesis/home?region=eu-west-1#/streams/details/production-events/details | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationAWSKinesisType](../../models/components/destinationawskinesistype.md) | :heavy_check_mark: | Type of the destination. | aws_kinesis | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.AWSKinesisConfig](../../models/components/awskinesisconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.AWSKinesisCredentials](../../models/components/awskinesiscredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (Kinesis stream name). Read-only. | production-events | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the stream). Read-only. | https://eu-west-1.console.aws.amazon.com/kinesis/home?region=eu-west-1#/streams/details/production-events/details | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationawss3.md b/sdks/outpost-go/docs/models/components/destinationawss3.md index ed2c10c6f..dc74159f1 100644 --- a/sdks/outpost-go/docs/models/components/destinationawss3.md +++ b/sdks/outpost-go/docs/models/components/destinationawss3.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationAwss3Type](../../models/components/destinationawss3type.md) | :heavy_check_mark: | Type of the destination. | aws_s3 | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (bucket and region). Read-only. | my-bucket in us-east-1 | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the bucket). Read-only. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationAwss3Type](../../models/components/destinationawss3type.md) | :heavy_check_mark: | Type of the destination. | aws_s3 | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (bucket and region). Read-only. | my-bucket in us-east-1 | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the bucket). Read-only. | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationawssqs.md b/sdks/outpost-go/docs/models/components/destinationawssqs.md index 2d62b85d4..238f02004 100644 --- a/sdks/outpost-go/docs/models/components/destinationawssqs.md +++ b/sdks/outpost-go/docs/models/components/destinationawssqs.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationAWSSQSType](../../models/components/destinationawssqstype.md) | :heavy_check_mark: | Type of the destination. | aws_sqs | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | [components.AWSSQSConfig](../../models/components/awssqsconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.AWSSQSCredentials](../../models/components/awssqscredentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (SQS queue name). Read-only. | my-app-queue | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the queue). Read-only. | https://us-west-2.console.aws.amazon.com/sqs/v2/home?region=us-west-2#/queues/https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F123456789012%2Fmy-app-queue | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationAWSSQSType](../../models/components/destinationawssqstype.md) | :heavy_check_mark: | Type of the destination. | aws_sqs | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.AWSSQSConfig](../../models/components/awssqsconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.AWSSQSCredentials](../../models/components/awssqscredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (SQS queue name). Read-only. | my-app-queue | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (AWS Console link to the queue). Read-only. | https://us-west-2.console.aws.amazon.com/sqs/v2/home?region=us-west-2#/queues/https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F123456789012%2Fmy-app-queue | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationazureservicebus.md b/sdks/outpost-go/docs/models/components/destinationazureservicebus.md index c913ad77b..55e428865 100644 --- a/sdks/outpost-go/docs/models/components/destinationazureservicebus.md +++ b/sdks/outpost-go/docs/models/components/destinationazureservicebus.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationAzureServiceBusType](../../models/components/destinationazureservicebustype.md) | :heavy_check_mark: | Type of the destination. | azure_servicebus | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | [components.AzureServiceBusConfig](../../models/components/azureservicebusconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.AzureServiceBusCredentials](../../models/components/azureservicebuscredentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (Azure Service Bus queue/topic name). Read-only. | my-queue-or-topic | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (Azure Portal link to the Service Bus). Read-only. | https://portal.azure.com/#@tenant-id/resource/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.ServiceBus/namespaces/namespace-name/queues/queue-name | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationAzureServiceBusType](../../models/components/destinationazureservicebustype.md) | :heavy_check_mark: | Type of the destination. | azure_servicebus | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.AzureServiceBusConfig](../../models/components/azureservicebusconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.AzureServiceBusCredentials](../../models/components/azureservicebuscredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (Azure Service Bus queue/topic name). Read-only. | my-queue-or-topic | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (Azure Portal link to the Service Bus). Read-only. | https://portal.azure.com/#@tenant-id/resource/subscriptions/subscription-id/resourceGroups/resource-group/providers/Microsoft.ServiceBus/namespaces/namespace-name/queues/queue-name | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreate.md b/sdks/outpost-go/docs/models/components/destinationcreate.md index 9b6941a94..c5c1f83e5 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreate.md +++ b/sdks/outpost-go/docs/models/components/destinationcreate.md @@ -45,3 +45,9 @@ destinationCreate := components.CreateDestinationCreateAzureServicebus(component destinationCreate := components.CreateDestinationCreateAwsS3(components.DestinationCreateAwss3{/* values here */}) ``` +### DestinationCreateGCPPubSub + +```go +destinationCreate := components.CreateDestinationCreateGcpPubsub(components.DestinationCreateGCPPubSub{/* values here */}) +``` + diff --git a/sdks/outpost-go/docs/models/components/destinationcreateawskinesis.md b/sdks/outpost-go/docs/models/components/destinationcreateawskinesis.md index 1b3bcd820..2d16282ad 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreateawskinesis.md +++ b/sdks/outpost-go/docs/models/components/destinationcreateawskinesis.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateAWSKinesisType](../../models/components/destinationcreateawskinesistype.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_kinesis'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | [components.AWSKinesisConfig](../../models/components/awskinesisconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.AWSKinesisCredentials](../../models/components/awskinesiscredentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateAWSKinesisType](../../models/components/destinationcreateawskinesistype.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_kinesis'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.AWSKinesisConfig](../../models/components/awskinesisconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.AWSKinesisCredentials](../../models/components/awskinesiscredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreateawss3.md b/sdks/outpost-go/docs/models/components/destinationcreateawss3.md index 6020ef503..fa28da887 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreateawss3.md +++ b/sdks/outpost-go/docs/models/components/destinationcreateawss3.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateAwss3Type](../../models/components/destinationcreateawss3type.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_s3'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateAwss3Type](../../models/components/destinationcreateawss3type.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_s3'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.Awss3Config](../../models/components/awss3config.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreateawssqs.md b/sdks/outpost-go/docs/models/components/destinationcreateawssqs.md index 569836de5..8ab1cf692 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreateawssqs.md +++ b/sdks/outpost-go/docs/models/components/destinationcreateawssqs.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateAWSSQSType](../../models/components/destinationcreateawssqstype.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_sqs'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | [components.AWSSQSConfig](../../models/components/awssqsconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.AWSSQSCredentials](../../models/components/awssqscredentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateAWSSQSType](../../models/components/destinationcreateawssqstype.md) | :heavy_check_mark: | Type of the destination. Must be 'aws_sqs'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.AWSSQSConfig](../../models/components/awssqsconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.AWSSQSCredentials](../../models/components/awssqscredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreateazureservicebus.md b/sdks/outpost-go/docs/models/components/destinationcreateazureservicebus.md index 11b375da8..6a43e434e 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreateazureservicebus.md +++ b/sdks/outpost-go/docs/models/components/destinationcreateazureservicebus.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateAzureServiceBusType](../../models/components/destinationcreateazureservicebustype.md) | :heavy_check_mark: | Type of the destination. Must be 'azure_servicebus'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | [components.AzureServiceBusConfig](../../models/components/azureservicebusconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.AzureServiceBusCredentials](../../models/components/azureservicebuscredentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateAzureServiceBusType](../../models/components/destinationcreateazureservicebustype.md) | :heavy_check_mark: | Type of the destination. Must be 'azure_servicebus'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.AzureServiceBusConfig](../../models/components/azureservicebusconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.AzureServiceBusCredentials](../../models/components/azureservicebuscredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreategcppubsub.md b/sdks/outpost-go/docs/models/components/destinationcreategcppubsub.md new file mode 100644 index 000000000..21347fb9b --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationcreategcppubsub.md @@ -0,0 +1,15 @@ +# DestinationCreateGCPPubSub + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateGCPPubSubType](../../models/components/destinationcreategcppubsubtype.md) | :heavy_check_mark: | Type of the destination. Must be 'gcp_pubsub'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.GCPPubSubConfig](../../models/components/gcppubsubconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.GCPPubSubCredentials](../../models/components/gcppubsubcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreategcppubsubtype.md b/sdks/outpost-go/docs/models/components/destinationcreategcppubsubtype.md new file mode 100644 index 000000000..409ddd9fb --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationcreategcppubsubtype.md @@ -0,0 +1,10 @@ +# DestinationCreateGCPPubSubType + +Type of the destination. Must be 'gcp_pubsub'. + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `DestinationCreateGCPPubSubTypeGcpPubsub` | gcp_pubsub | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreatehookdeck.md b/sdks/outpost-go/docs/models/components/destinationcreatehookdeck.md index d38bd0557..d0d35b2b6 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreatehookdeck.md +++ b/sdks/outpost-go/docs/models/components/destinationcreatehookdeck.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateHookdeckType](../../models/components/destinationcreatehookdecktype.md) | :heavy_check_mark: | Type of the destination. Must be 'hookdeck'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | *any* | :heavy_minus_sign: | N/A | | -| `Credentials` | [components.HookdeckCredentials](../../models/components/hookdeckcredentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateHookdeckType](../../models/components/destinationcreatehookdecktype.md) | :heavy_check_mark: | Type of the destination. Must be 'hookdeck'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | *any* | :heavy_minus_sign: | N/A | | +| `Credentials` | [components.HookdeckCredentials](../../models/components/hookdeckcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreaterabbitmq.md b/sdks/outpost-go/docs/models/components/destinationcreaterabbitmq.md index cfa242c86..438cf45c3 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreaterabbitmq.md +++ b/sdks/outpost-go/docs/models/components/destinationcreaterabbitmq.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateRabbitMQType](../../models/components/destinationcreaterabbitmqtype.md) | :heavy_check_mark: | Type of the destination. Must be 'rabbitmq'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | [components.RabbitMQConfig](../../models/components/rabbitmqconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.RabbitMQCredentials](../../models/components/rabbitmqcredentials.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateRabbitMQType](../../models/components/destinationcreaterabbitmqtype.md) | :heavy_check_mark: | Type of the destination. Must be 'rabbitmq'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.RabbitMQConfig](../../models/components/rabbitmqconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.RabbitMQCredentials](../../models/components/rabbitmqcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationcreatewebhook.md b/sdks/outpost-go/docs/models/components/destinationcreatewebhook.md index 075f3ddec..48521fca4 100644 --- a/sdks/outpost-go/docs/models/components/destinationcreatewebhook.md +++ b/sdks/outpost-go/docs/models/components/destinationcreatewebhook.md @@ -3,10 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | -| `Type` | [components.DestinationCreateWebhookType](../../models/components/destinationcreatewebhooktype.md) | :heavy_check_mark: | Type of the destination. Must be 'webhook'. | | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `Config` | [components.WebhookConfig](../../models/components/webhookconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [*components.WebhookCredentials](../../models/components/webhookcredentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | Optional user-provided ID. A UUID will be generated if empty. | user-provided-id | +| `Type` | [components.DestinationCreateWebhookType](../../models/components/destinationcreatewebhooktype.md) | :heavy_check_mark: | Type of the destination. Must be 'webhook'. | | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [components.WebhookConfig](../../models/components/webhookconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [*components.WebhookCredentials](../../models/components/webhookcredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationgcppubsub.md b/sdks/outpost-go/docs/models/components/destinationgcppubsub.md new file mode 100644 index 000000000..766476405 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationgcppubsub.md @@ -0,0 +1,20 @@ +# DestinationGCPPubSub + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationGCPPubSubType](../../models/components/destinationgcppubsubtype.md) | :heavy_check_mark: | Type of the destination. | gcp_pubsub | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.GCPPubSubConfig](../../models/components/gcppubsubconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.GCPPubSubCredentials](../../models/components/gcppubsubcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (project/topic). Read-only. | my-project-123/events-topic | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (GCP Console link to the topic). Read-only. | https://console.cloud.google.com/cloudpubsub/topic/detail/events-topic?project=my-project-123 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationgcppubsubtype.md b/sdks/outpost-go/docs/models/components/destinationgcppubsubtype.md new file mode 100644 index 000000000..1ca603890 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationgcppubsubtype.md @@ -0,0 +1,10 @@ +# DestinationGCPPubSubType + +Type of the destination. + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `DestinationGCPPubSubTypeGcpPubsub` | gcp_pubsub | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationhookdeck.md b/sdks/outpost-go/docs/models/components/destinationhookdeck.md index 4ea41c6a0..8b217e0e6 100644 --- a/sdks/outpost-go/docs/models/components/destinationhookdeck.md +++ b/sdks/outpost-go/docs/models/components/destinationhookdeck.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationHookdeckType](../../models/components/destinationhookdecktype.md) | :heavy_check_mark: | Type of the destination. | hookdeck | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | *any* | :heavy_minus_sign: | N/A | | -| `Credentials` | [components.HookdeckCredentials](../../models/components/hookdeckcredentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (Hookdeck). Read-only. | Hookdeck | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (e.g., Hookdeck dashboard). Read-only. | https://dashboard.hookdeck.com/sources/src_xxxyyyzzz | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationHookdeckType](../../models/components/destinationhookdecktype.md) | :heavy_check_mark: | Type of the destination. | hookdeck | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | *any* | :heavy_minus_sign: | N/A | | +| `Credentials` | [components.HookdeckCredentials](../../models/components/hookdeckcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (Hookdeck). Read-only. | Hookdeck | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (e.g., Hookdeck dashboard). Read-only. | https://dashboard.hookdeck.com/sources/src_xxxyyyzzz | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationrabbitmq.md b/sdks/outpost-go/docs/models/components/destinationrabbitmq.md index 306f41705..5bad05f05 100644 --- a/sdks/outpost-go/docs/models/components/destinationrabbitmq.md +++ b/sdks/outpost-go/docs/models/components/destinationrabbitmq.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationRabbitMQType](../../models/components/destinationrabbitmqtype.md) | :heavy_check_mark: | Type of the destination. | rabbitmq | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | [components.RabbitMQConfig](../../models/components/rabbitmqconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.RabbitMQCredentials](../../models/components/rabbitmqcredentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (RabbitMQ exchange). Read-only. | events-exchange | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (not applicable for RabbitMQ exchange). Read-only. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationRabbitMQType](../../models/components/destinationrabbitmqtype.md) | :heavy_check_mark: | Type of the destination. | rabbitmq | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.RabbitMQConfig](../../models/components/rabbitmqconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.RabbitMQCredentials](../../models/components/rabbitmqcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (RabbitMQ exchange). Read-only. | events-exchange | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (not applicable for RabbitMQ exchange). Read-only. | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationtype.md b/sdks/outpost-go/docs/models/components/destinationtype.md new file mode 100644 index 000000000..1cdfbc854 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationtype.md @@ -0,0 +1,17 @@ +# DestinationType + +Type of destination. + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `DestinationTypeWebhook` | webhook | +| `DestinationTypeAwsSqs` | aws_sqs | +| `DestinationTypeRabbitmq` | rabbitmq | +| `DestinationTypeHookdeck` | hookdeck | +| `DestinationTypeAwsKinesis` | aws_kinesis | +| `DestinationTypeAzureServicebus` | azure_servicebus | +| `DestinationTypeAwsS3` | aws_s3 | +| `DestinationTypeGcpPubsub` | gcp_pubsub | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdate.md b/sdks/outpost-go/docs/models/components/destinationupdate.md index 2c0bca0b3..63c548e06 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdate.md +++ b/sdks/outpost-go/docs/models/components/destinationupdate.md @@ -33,9 +33,21 @@ destinationUpdate := components.CreateDestinationUpdateDestinationUpdateHookdeck destinationUpdate := components.CreateDestinationUpdateDestinationUpdateAWSKinesis(components.DestinationUpdateAWSKinesis{/* values here */}) ``` +### DestinationUpdateAzureServiceBus + +```go +destinationUpdate := components.CreateDestinationUpdateDestinationUpdateAzureServiceBus(components.DestinationUpdateAzureServiceBus{/* values here */}) +``` + ### DestinationUpdateAwss3 ```go destinationUpdate := components.CreateDestinationUpdateDestinationUpdateAwss3(components.DestinationUpdateAwss3{/* values here */}) ``` +### DestinationUpdateGCPPubSub + +```go +destinationUpdate := components.CreateDestinationUpdateDestinationUpdateGCPPubSub(components.DestinationUpdateGCPPubSub{/* values here */}) +``` + diff --git a/sdks/outpost-go/docs/models/components/destinationupdateawskinesis.md b/sdks/outpost-go/docs/models/components/destinationupdateawskinesis.md index 1de385ced..d7e991abd 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdateawskinesis.md +++ b/sdks/outpost-go/docs/models/components/destinationupdateawskinesis.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | -| `Config` | [*components.AWSKinesisConfig](../../models/components/awskinesisconfig.md) | :heavy_minus_sign: | N/A | | -| `Credentials` | [*components.AWSKinesisCredentials](../../models/components/awskinesiscredentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.AWSKinesisConfig](../../models/components/awskinesisconfig.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.AWSKinesisCredentials](../../models/components/awskinesiscredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdateawss3.md b/sdks/outpost-go/docs/models/components/destinationupdateawss3.md index dbf8f5ef6..dc0e930b4 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdateawss3.md +++ b/sdks/outpost-go/docs/models/components/destinationupdateawss3.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | -| `Config` | [*components.Awss3Config](../../models/components/awss3config.md) | :heavy_minus_sign: | N/A | | -| `Credentials` | [*components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.Awss3Config](../../models/components/awss3config.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.Awss3Credentials](../../models/components/awss3credentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdateawssqs.md b/sdks/outpost-go/docs/models/components/destinationupdateawssqs.md index 3b8b2439a..c46ee2c3d 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdateawssqs.md +++ b/sdks/outpost-go/docs/models/components/destinationupdateawssqs.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | -| `Config` | [*components.AWSSQSConfig](../../models/components/awssqsconfig.md) | :heavy_minus_sign: | N/A | | -| `Credentials` | [*components.AWSSQSCredentials](../../models/components/awssqscredentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.AWSSQSConfig](../../models/components/awssqsconfig.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.AWSSQSCredentials](../../models/components/awssqscredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdateazureservicebus.md b/sdks/outpost-go/docs/models/components/destinationupdateazureservicebus.md new file mode 100644 index 000000000..67abfea1c --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationupdateazureservicebus.md @@ -0,0 +1,13 @@ +# DestinationUpdateAzureServiceBus + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.AzureServiceBusConfig](../../models/components/azureservicebusconfig.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.AzureServiceBusCredentials](../../models/components/azureservicebuscredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdategcppubsub.md b/sdks/outpost-go/docs/models/components/destinationupdategcppubsub.md new file mode 100644 index 000000000..abb0ff527 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/destinationupdategcppubsub.md @@ -0,0 +1,13 @@ +# DestinationUpdateGCPPubSub + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.GCPPubSubConfig](../../models/components/gcppubsubconfig.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.GCPPubSubCredentials](../../models/components/gcppubsubcredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdatehookdeck.md b/sdks/outpost-go/docs/models/components/destinationupdatehookdeck.md index 79dba4a33..318ddc5c8 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdatehookdeck.md +++ b/sdks/outpost-go/docs/models/components/destinationupdatehookdeck.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | -| `Config` | *any* | :heavy_minus_sign: | N/A | | -| `Credentials` | [*components.HookdeckCredentials](../../models/components/hookdeckcredentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | *any* | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.HookdeckCredentials](../../models/components/hookdeckcredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdaterabbitmq.md b/sdks/outpost-go/docs/models/components/destinationupdaterabbitmq.md index 16ef9bdeb..7caa568ed 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdaterabbitmq.md +++ b/sdks/outpost-go/docs/models/components/destinationupdaterabbitmq.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | -| `Config` | [*components.RabbitMQConfig](../../models/components/rabbitmqconfig.md) | :heavy_minus_sign: | N/A | | -| `Credentials` | [*components.RabbitMQCredentials](../../models/components/rabbitmqcredentials.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.RabbitMQConfig](../../models/components/rabbitmqconfig.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.RabbitMQCredentials](../../models/components/rabbitmqcredentials.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationupdatewebhook.md b/sdks/outpost-go/docs/models/components/destinationupdatewebhook.md index 6868c2b6a..255b90891 100644 --- a/sdks/outpost-go/docs/models/components/destinationupdatewebhook.md +++ b/sdks/outpost-go/docs/models/components/destinationupdatewebhook.md @@ -3,8 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | -| `Config` | [*components.WebhookConfig](../../models/components/webhookconfig.md) | :heavy_minus_sign: | N/A | | -| `Credentials` | [*components.WebhookCredentialsUpdate](../../models/components/webhookcredentialsupdate.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `Topics` | [*components.Topics](../../models/components/topics.md) | :heavy_minus_sign: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `Config` | [*components.WebhookConfig](../../models/components/webhookconfig.md) | :heavy_minus_sign: | N/A | | +| `Credentials` | [*components.WebhookCredentialsUpdate](../../models/components/webhookcredentialsupdate.md) | :heavy_minus_sign: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/destinationwebhook.md b/sdks/outpost-go/docs/models/components/destinationwebhook.md index 87018f1ae..96dc5048d 100644 --- a/sdks/outpost-go/docs/models/components/destinationwebhook.md +++ b/sdks/outpost-go/docs/models/components/destinationwebhook.md @@ -3,14 +3,18 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | -| `Type` | [components.DestinationWebhookType](../../models/components/destinationwebhooktype.md) | :heavy_check_mark: | Type of the destination. | webhook | -| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | -| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | -| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | -| `Config` | [components.WebhookConfig](../../models/components/webhookconfig.md) | :heavy_check_mark: | N/A | | -| `Credentials` | [components.WebhookCredentials](../../models/components/webhookcredentials.md) | :heavy_check_mark: | N/A | | -| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (e.g., URL host). Read-only. | my-service.com | -| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (the webhook URL). Read-only. | https://my-service.com/webhook/handler | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ID` | *string* | :heavy_check_mark: | Control plane generated ID or user provided ID for the destination. | des_12345 | +| `Type` | [components.DestinationWebhookType](../../models/components/destinationwebhooktype.md) | :heavy_check_mark: | Type of the destination. | webhook | +| `Topics` | [components.Topics](../../models/components/topics.md) | :heavy_check_mark: | "*" or an array of enabled topics. | * | +| `Filter` | map[string]*any* | :heavy_minus_sign: | Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination.
Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not.
If null or empty, all events matching the topic filter will be delivered.
To remove an existing filter when updating a destination, set filter to an empty object `{}`.
| {
"data": {
"amount": {
"$gte": 100
},
"customer": {
"tier": "premium"
}
}
} | +| `DisabledAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was disabled, or null if enabled. | | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | ISO Date when the destination was last updated. | 2024-01-01T00:00:00Z | +| `Config` | [components.WebhookConfig](../../models/components/webhookconfig.md) | :heavy_check_mark: | N/A | | +| `Credentials` | [components.WebhookCredentials](../../models/components/webhookcredentials.md) | :heavy_check_mark: | N/A | | +| `DeliveryMetadata` | map[string]*string* | :heavy_minus_sign: | Static key-value pairs merged into event metadata on every delivery. | {
"app-id": "my-app",
"region": "us-east-1"
} | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary contextual information stored with the destination. | {
"internal-id": "123",
"team": "platform"
} | +| `Target` | **string* | :heavy_minus_sign: | A human-readable representation of the destination target (e.g., URL host). Read-only. | my-service.com | +| `TargetURL` | **string* | :heavy_minus_sign: | A URL link to the destination target (the webhook URL). Read-only. | https://my-service.com/webhook/handler | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/event.md b/sdks/outpost-go/docs/models/components/event.md index 3a4df7140..cab472aa7 100644 --- a/sdks/outpost-go/docs/models/components/event.md +++ b/sdks/outpost-go/docs/models/components/event.md @@ -3,12 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | evt_123 | -| `DestinationID` | **string* | :heavy_minus_sign: | N/A | des_456 | -| `Topic` | **string* | :heavy_minus_sign: | N/A | user.created | -| `Time` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Time the event was received/processed. | 2024-01-01T00:00:00Z | -| `SuccessfulAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Time the event was successfully delivered. | 2024-01-01T00:00:00Z | -| `Metadata` | map[string]*string* | :heavy_minus_sign: | Key-value string pairs of metadata associated with the event. | {
"source": "crm"
} | -| `Data` | map[string]*any* | :heavy_minus_sign: | Freeform JSON data of the event. | {
"user_id": "userid",
"status": "active"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ID` | **string* | :heavy_minus_sign: | N/A | evt_123 | +| `DestinationID` | **string* | :heavy_minus_sign: | N/A | des_456 | +| `Topic` | **string* | :heavy_minus_sign: | N/A | user.created | +| `Time` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Time the event was received/processed. | 2024-01-01T00:00:00Z | +| `SuccessfulAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | Time the event was successfully delivered. | 2024-01-01T00:00:00Z | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Key-value string pairs of metadata associated with the event. | {
"source": "crm"
} | +| `Status` | [*components.EventStatus](../../models/components/eventstatus.md) | :heavy_minus_sign: | N/A | success | +| `Data` | map[string]*any* | :heavy_minus_sign: | Freeform JSON data of the event. | {
"user_id": "userid",
"status": "active"
} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/eventstatus.md b/sdks/outpost-go/docs/models/components/eventstatus.md new file mode 100644 index 000000000..e88072caf --- /dev/null +++ b/sdks/outpost-go/docs/models/components/eventstatus.md @@ -0,0 +1,9 @@ +# EventStatus + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `EventStatusSuccess` | success | +| `EventStatusFailed` | failed | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/gcppubsubconfig.md b/sdks/outpost-go/docs/models/components/gcppubsubconfig.md new file mode 100644 index 000000000..3455e10f9 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/gcppubsubconfig.md @@ -0,0 +1,10 @@ +# GCPPubSubConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `ProjectID` | *string* | :heavy_check_mark: | The GCP project ID. | my-project-123 | +| `Topic` | *string* | :heavy_check_mark: | The Pub/Sub topic name. | events-topic | +| `Endpoint` | **string* | :heavy_minus_sign: | Optional. Custom endpoint URL (e.g., localhost:8085 for emulator). | pubsub.googleapis.com:443 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/gcppubsubcredentials.md b/sdks/outpost-go/docs/models/components/gcppubsubcredentials.md new file mode 100644 index 000000000..e5a2e9e72 --- /dev/null +++ b/sdks/outpost-go/docs/models/components/gcppubsubcredentials.md @@ -0,0 +1,8 @@ +# GCPPubSubCredentials + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ServiceAccountJSON` | *string* | :heavy_check_mark: | Service account key JSON. The entire JSON key file content as a string. | {"type":"service_account","project_id":"my-project","private_key_id":"key123","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","client_email":"my-service@my-project.iam.gserviceaccount.com"} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/portalredirect.md b/sdks/outpost-go/docs/models/components/portalredirect.md index 73367f4ca..768eb5c98 100644 --- a/sdks/outpost-go/docs/models/components/portalredirect.md +++ b/sdks/outpost-go/docs/models/components/portalredirect.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `RedirectURL` | **string* | :heavy_minus_sign: | Redirect URL containing a JWT to authenticate the user with the portal. | https://webhooks.acme.com/?token=JWT_TOKEN | \ No newline at end of file +| `RedirectURL` | **string* | :heavy_minus_sign: | Redirect URL containing a JWT to authenticate the user with the portal. | https://webhooks.acme.com/?token=JWT_TOKEN&tenant_id=tenant_123 | +| `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant associated with this portal session. | tenant_123 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/publishresponse.md b/sdks/outpost-go/docs/models/components/publishresponse.md index c2c2dc270..4fb2aca03 100644 --- a/sdks/outpost-go/docs/models/components/publishresponse.md +++ b/sdks/outpost-go/docs/models/components/publishresponse.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `ID` | *string* | :heavy_check_mark: | The ID of the event that was accepted for publishing. This will be the ID provided in the request's `id` field if present, otherwise it's a server-generated UUID. | evt_abc123xyz789 | \ No newline at end of file +| `ID` | *string* | :heavy_check_mark: | The ID of the event that was accepted for publishing. This will be the ID provided in the request's `id` field if present, otherwise it's a server-generated UUID. | evt_abc123xyz789 | +| `Duplicate` | *bool* | :heavy_check_mark: | Whether this event was already processed (idempotency hit). If true, the event was not queued again. | false | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/status.md b/sdks/outpost-go/docs/models/components/status.md deleted file mode 100644 index 553f3920b..000000000 --- a/sdks/outpost-go/docs/models/components/status.md +++ /dev/null @@ -1,9 +0,0 @@ -# Status - - -## Values - -| Name | Value | -| --------------- | --------------- | -| `StatusSuccess` | success | -| `StatusFailed` | failed | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/tenant.md b/sdks/outpost-go/docs/models/components/tenant.md index 434419c55..b2626a9f6 100644 --- a/sdks/outpost-go/docs/models/components/tenant.md +++ b/sdks/outpost-go/docs/models/components/tenant.md @@ -3,9 +3,11 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `ID` | **string* | :heavy_minus_sign: | User-defined system ID for the tenant. | 123 | -| `DestinationsCount` | **int64* | :heavy_minus_sign: | Number of destinations associated with the tenant. | 5 | -| `Topics` | []*string* | :heavy_minus_sign: | List of subscribed topics across all destinations for this tenant. | [
"user.created",
"user.deleted"
] | -| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the tenant was created. | 2024-01-01T00:00:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | User-defined system ID for the tenant. | 123 | +| `DestinationsCount` | **int64* | :heavy_minus_sign: | Number of destinations associated with the tenant. | 5 | +| `Topics` | []*string* | :heavy_minus_sign: | List of subscribed topics across all destinations for this tenant. | [
"user.created",
"user.deleted"
] | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary key-value pairs for storing contextual information about the tenant. | | +| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the tenant was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the tenant was last updated. | 2024-01-01T00:00:00Z | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/tenantlistitem.md b/sdks/outpost-go/docs/models/components/tenantlistitem.md new file mode 100644 index 000000000..196a0ddcd --- /dev/null +++ b/sdks/outpost-go/docs/models/components/tenantlistitem.md @@ -0,0 +1,15 @@ +# TenantListItem + +Tenant object returned in list operations. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ID` | **string* | :heavy_minus_sign: | User-defined system ID for the tenant. | 123 | +| `DestinationsCount` | **int64* | :heavy_minus_sign: | Number of destinations associated with the tenant. | 5 | +| `Topics` | []*string* | :heavy_minus_sign: | List of subscribed topics across all destinations for this tenant. | [
"user.created",
"user.deleted"
] | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Arbitrary key-value pairs for storing contextual information about the tenant. | | +| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the tenant was created. | 2024-01-01T00:00:00Z | +| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | ISO Date when the tenant was last updated. | 2024-01-01T00:00:00Z | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/tenantlistresponse.md b/sdks/outpost-go/docs/models/components/tenantlistresponse.md new file mode 100644 index 000000000..e64d423df --- /dev/null +++ b/sdks/outpost-go/docs/models/components/tenantlistresponse.md @@ -0,0 +1,13 @@ +# TenantListResponse + +Paginated list of tenants. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Data` | [][components.TenantListItem](../../models/components/tenantlistitem.md) | :heavy_minus_sign: | Array of tenant objects. | | +| `Next` | **string* | :heavy_minus_sign: | Cursor for the next page of results. Null if no more results. | MTcwNDA2NzIwMA== | +| `Prev` | **string* | :heavy_minus_sign: | Cursor for the previous page of results. Null if on first page. | | +| `Count` | **int64* | :heavy_minus_sign: | Total count of all tenants. | 42 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/tenanttoken.md b/sdks/outpost-go/docs/models/components/tenanttoken.md index 059078ef2..1a68f6f23 100644 --- a/sdks/outpost-go/docs/models/components/tenanttoken.md +++ b/sdks/outpost-go/docs/models/components/tenanttoken.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `Token` | **string* | :heavy_minus_sign: | JWT token scoped to the tenant for safe browser API calls. | SOME_JWT_TOKEN | \ No newline at end of file +| `Token` | **string* | :heavy_minus_sign: | JWT token scoped to the tenant for safe browser API calls. | SOME_JWT_TOKEN | +| `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant this token is scoped to. | tenant_123 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/tenantupsert.md b/sdks/outpost-go/docs/models/components/tenantupsert.md new file mode 100644 index 000000000..4d2bab11b --- /dev/null +++ b/sdks/outpost-go/docs/models/components/tenantupsert.md @@ -0,0 +1,8 @@ +# TenantUpsert + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `Metadata` | map[string]*string* | :heavy_minus_sign: | Optional metadata to store with the tenant. | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/components/webhookconfig.md b/sdks/outpost-go/docs/models/components/webhookconfig.md index 3f17b3923..0fd9836e7 100644 --- a/sdks/outpost-go/docs/models/components/webhookconfig.md +++ b/sdks/outpost-go/docs/models/components/webhookconfig.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `URL` | *string* | :heavy_check_mark: | The URL to send the webhook events to. | https://example.com/webhooks/user | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `URL` | *string* | :heavy_check_mark: | The URL to send the webhook events to. | https://example.com/webhooks/user | +| `CustomHeaders` | **string* | :heavy_minus_sign: | JSON string of custom HTTP headers to include with every webhook request. Header names must be valid HTTP header tokens (alphanumeric, hyphens, underscores). Reserved headers (Content-Type, Host, etc.) cannot be overridden. | {"x-api-key":"secret123","x-tenant-id":"customer-456"} | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/createtenantdestinationrequest.md b/sdks/outpost-go/docs/models/operations/createtenantdestinationrequest.md index 5f0bd808e..529ab84f5 100644 --- a/sdks/outpost-go/docs/models/operations/createtenantdestinationrequest.md +++ b/sdks/outpost-go/docs/models/operations/createtenantdestinationrequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | -| `DestinationCreate` | [components.DestinationCreate](../../models/components/destinationcreate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `Params` | [components.DestinationCreate](../../models/components/destinationcreate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/healthcheckresponse.md b/sdks/outpost-go/docs/models/operations/healthcheckresponse.md index 2fcdb3fa0..ad03cea1d 100644 --- a/sdks/outpost-go/docs/models/operations/healthcheckresponse.md +++ b/sdks/outpost-go/docs/models/operations/healthcheckresponse.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `Res` | **string* | :heavy_minus_sign: | Service is healthy. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `Object` | [*operations.HealthCheckResponseBody](../../models/operations/healthcheckresponsebody.md) | :heavy_minus_sign: | Service is healthy - all workers are operational. | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/healthcheckresponsebody.md b/sdks/outpost-go/docs/models/operations/healthcheckresponsebody.md new file mode 100644 index 000000000..1cb88348b --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/healthcheckresponsebody.md @@ -0,0 +1,12 @@ +# HealthCheckResponseBody + +Service is healthy - all workers are operational. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Status` | [operations.HealthCheckStatus1](../../models/operations/healthcheckstatus1.md) | :heavy_check_mark: | N/A | healthy | +| `Timestamp` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | When this health check was performed | 2025-11-11T10:30:00Z | +| `Workers` | map[string][operations.Workers](../../models/operations/workers.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/healthcheckstatus1.md b/sdks/outpost-go/docs/models/operations/healthcheckstatus1.md new file mode 100644 index 000000000..f25dda988 --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/healthcheckstatus1.md @@ -0,0 +1,8 @@ +# HealthCheckStatus1 + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `HealthCheckStatus1Healthy` | healthy | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/healthcheckstatus2.md b/sdks/outpost-go/docs/models/operations/healthcheckstatus2.md new file mode 100644 index 000000000..c32a42245 --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/healthcheckstatus2.md @@ -0,0 +1,8 @@ +# HealthCheckStatus2 + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `HealthCheckStatus2Healthy` | healthy | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenantdestinationsrequest.md b/sdks/outpost-go/docs/models/operations/listtenantdestinationsrequest.md index 48cb71747..93bf8ba01 100644 --- a/sdks/outpost-go/docs/models/operations/listtenantdestinationsrequest.md +++ b/sdks/outpost-go/docs/models/operations/listtenantdestinationsrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | -| `Type` | [*operations.Type](../../models/operations/type.md) | :heavy_minus_sign: | Filter destinations by type(s). | -| `Topics` | [*operations.Topics](../../models/operations/topics.md) | :heavy_minus_sign: | Filter destinations by supported topic(s). | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | +| `Type` | [*operations.ListTenantDestinationsType](../../models/operations/listtenantdestinationstype.md) | :heavy_minus_sign: | Filter destinations by type(s). | +| `Topics` | [*operations.Topics](../../models/operations/topics.md) | :heavy_minus_sign: | Filter destinations by supported topic(s). | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenantdestinationstype.md b/sdks/outpost-go/docs/models/operations/listtenantdestinationstype.md new file mode 100644 index 000000000..db505082e --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/listtenantdestinationstype.md @@ -0,0 +1,19 @@ +# ListTenantDestinationsType + +Filter destinations by type(s). + + +## Supported Types + +### DestinationType + +```go +listTenantDestinationsType := operations.CreateListTenantDestinationsTypeDestinationType(components.DestinationType{/* values here */}) +``` + +### + +```go +listTenantDestinationsType := operations.CreateListTenantDestinationsTypeArrayOfDestinationType([]components.DestinationType{/* values here */}) +``` + diff --git a/sdks/outpost-go/docs/models/operations/listtenantdestinationstypeenum1.md b/sdks/outpost-go/docs/models/operations/listtenantdestinationstypeenum1.md deleted file mode 100644 index 71290ae7b..000000000 --- a/sdks/outpost-go/docs/models/operations/listtenantdestinationstypeenum1.md +++ /dev/null @@ -1,13 +0,0 @@ -# ListTenantDestinationsTypeEnum1 - - -## Values - -| Name | Value | -| ------------------------------------------- | ------------------------------------------- | -| `ListTenantDestinationsTypeEnum1Webhook` | webhook | -| `ListTenantDestinationsTypeEnum1AwsSqs` | aws_sqs | -| `ListTenantDestinationsTypeEnum1Rabbitmq` | rabbitmq | -| `ListTenantDestinationsTypeEnum1Hookdeck` | hookdeck | -| `ListTenantDestinationsTypeEnum1AwsKinesis` | aws_kinesis | -| `ListTenantDestinationsTypeEnum1AwsS3` | aws_s3 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenantdestinationstypeenum2.md b/sdks/outpost-go/docs/models/operations/listtenantdestinationstypeenum2.md deleted file mode 100644 index 90c202977..000000000 --- a/sdks/outpost-go/docs/models/operations/listtenantdestinationstypeenum2.md +++ /dev/null @@ -1,13 +0,0 @@ -# ListTenantDestinationsTypeEnum2 - - -## Values - -| Name | Value | -| ------------------------------------------- | ------------------------------------------- | -| `ListTenantDestinationsTypeEnum2Webhook` | webhook | -| `ListTenantDestinationsTypeEnum2AwsSqs` | aws_sqs | -| `ListTenantDestinationsTypeEnum2Rabbitmq` | rabbitmq | -| `ListTenantDestinationsTypeEnum2Hookdeck` | hookdeck | -| `ListTenantDestinationsTypeEnum2AwsKinesis` | aws_kinesis | -| `ListTenantDestinationsTypeEnum2AwsS3` | aws_s3 | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenanteventsbydestinationresponsebody.md b/sdks/outpost-go/docs/models/operations/listtenanteventsbydestinationresponsebody.md index f0b9e04e3..404b319d4 100644 --- a/sdks/outpost-go/docs/models/operations/listtenanteventsbydestinationresponsebody.md +++ b/sdks/outpost-go/docs/models/operations/listtenanteventsbydestinationresponsebody.md @@ -9,5 +9,5 @@ A paginated list of events for the destination. | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | | `Count` | *int64* | :heavy_check_mark: | Total number of items across all pages | 42 | | `Data` | [][components.Event](../../models/components/event.md) | :heavy_check_mark: | N/A | | -| `Next` | *string* | :heavy_check_mark: | Cursor for next page (empty string if no next page) | | -| `Prev` | *string* | :heavy_check_mark: | Cursor for previous page (empty string if no previous page) | | \ No newline at end of file +| `NextCursor` | *string* | :heavy_check_mark: | Cursor for next page (empty string if no next page) | | +| `PrevCursor` | *string* | :heavy_check_mark: | Cursor for previous page (empty string if no previous page) | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenanteventsresponsebody.md b/sdks/outpost-go/docs/models/operations/listtenanteventsresponsebody.md index 1fd825b16..c63b5e750 100644 --- a/sdks/outpost-go/docs/models/operations/listtenanteventsresponsebody.md +++ b/sdks/outpost-go/docs/models/operations/listtenanteventsresponsebody.md @@ -9,5 +9,5 @@ A paginated list of events. | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | | `Count` | *int64* | :heavy_check_mark: | Total number of items across all pages | 42 | | `Data` | [][components.Event](../../models/components/event.md) | :heavy_check_mark: | N/A | | -| `Next` | *string* | :heavy_check_mark: | Cursor for next page (empty string if no next page) | | -| `Prev` | *string* | :heavy_check_mark: | Cursor for previous page (empty string if no previous page) | | \ No newline at end of file +| `NextCursor` | *string* | :heavy_check_mark: | Cursor for next page (empty string if no next page) | | +| `PrevCursor` | *string* | :heavy_check_mark: | Cursor for previous page (empty string if no previous page) | | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenantsrequest.md b/sdks/outpost-go/docs/models/operations/listtenantsrequest.md new file mode 100644 index 000000000..f57b05004 --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/listtenantsrequest.md @@ -0,0 +1,11 @@ +# ListTenantsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Limit` | **int64* | :heavy_minus_sign: | Number of tenants to return per page (1-100, default 20). | +| `Order` | [*operations.Order](../../models/operations/order.md) | :heavy_minus_sign: | Sort order by `created_at` timestamp. | +| `Next` | **string* | :heavy_minus_sign: | Cursor for the next page of results. Mutually exclusive with `prev`. | +| `Prev` | **string* | :heavy_minus_sign: | Cursor for the previous page of results. Mutually exclusive with `next`. | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/listtenantsresponse.md b/sdks/outpost-go/docs/models/operations/listtenantsresponse.md new file mode 100644 index 000000000..aed34d286 --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/listtenantsresponse.md @@ -0,0 +1,9 @@ +# ListTenantsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `HTTPMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `TenantListResponse` | [*components.TenantListResponse](../../models/components/tenantlistresponse.md) | :heavy_minus_sign: | List of tenants. | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/order.md b/sdks/outpost-go/docs/models/operations/order.md new file mode 100644 index 000000000..4f3c15d9b --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/order.md @@ -0,0 +1,11 @@ +# Order + +Sort order by `created_at` timestamp. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `OrderAsc` | asc | +| `OrderDesc` | desc | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/type.md b/sdks/outpost-go/docs/models/operations/type.md deleted file mode 100644 index 1fc4e08da..000000000 --- a/sdks/outpost-go/docs/models/operations/type.md +++ /dev/null @@ -1,19 +0,0 @@ -# Type - -Filter destinations by type(s). - - -## Supported Types - -### ListTenantDestinationsTypeEnum1 - -```go -type := operations.CreateTypeListTenantDestinationsTypeEnum1(operations.ListTenantDestinationsTypeEnum1{/* values here */}) -``` - -### - -```go -type := operations.CreateTypeArrayOfListTenantDestinationsTypeEnum2([]operations.ListTenantDestinationsTypeEnum2{/* values here */}) -``` - diff --git a/sdks/outpost-go/docs/models/operations/updatetenantdestinationrequest.md b/sdks/outpost-go/docs/models/operations/updatetenantdestinationrequest.md index 9c93bcdb1..330baa42d 100644 --- a/sdks/outpost-go/docs/models/operations/updatetenantdestinationrequest.md +++ b/sdks/outpost-go/docs/models/operations/updatetenantdestinationrequest.md @@ -7,4 +7,4 @@ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | | `DestinationID` | *string* | :heavy_check_mark: | The ID of the destination. | -| `DestinationUpdate` | [components.DestinationUpdate](../../models/components/destinationupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `Params` | [components.DestinationUpdate](../../models/components/destinationupdate.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/upserttenantrequest.md b/sdks/outpost-go/docs/models/operations/upserttenantrequest.md index 4ee9e26d3..23138085f 100644 --- a/sdks/outpost-go/docs/models/operations/upserttenantrequest.md +++ b/sdks/outpost-go/docs/models/operations/upserttenantrequest.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | \ No newline at end of file +| `TenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | +| `Params` | [*components.TenantUpsert](../../models/components/tenantupsert.md) | :heavy_minus_sign: | Optional tenant metadata | \ No newline at end of file diff --git a/sdks/outpost-go/docs/models/operations/workers.md b/sdks/outpost-go/docs/models/operations/workers.md new file mode 100644 index 000000000..2ee4dd095 --- /dev/null +++ b/sdks/outpost-go/docs/models/operations/workers.md @@ -0,0 +1,8 @@ +# Workers + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Status` | [operations.HealthCheckStatus2](../../models/operations/healthcheckstatus2.md) | :heavy_check_mark: | N/A | healthy | \ No newline at end of file diff --git a/sdks/outpost-go/docs/sdks/destinations/README.md b/sdks/outpost-go/docs/sdks/destinations/README.md index bd0bf1535..9651cad85 100644 --- a/sdks/outpost-go/docs/sdks/destinations/README.md +++ b/sdks/outpost-go/docs/sdks/destinations/README.md @@ -1,5 +1,4 @@ # Destinations -(*Destinations*) ## Overview @@ -44,14 +43,15 @@ Return a list of the destinations for the tenant. The endpoint is not paged. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" + "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" "log" ) @@ -61,11 +61,13 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) - res, err := s.Destinations.List(ctx, nil, nil) + res, err := s.Destinations.List(ctx, outpostgo.Pointer(operations.CreateListTenantDestinationsTypeDestinationType( + components.DestinationTypeWebhook, + )), nil) if err != nil { log.Fatal(err) } @@ -77,13 +79,13 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `tenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | -| `type_` | [*operations.Type](../../models/operations/type.md) | :heavy_minus_sign: | Filter destinations by type(s). | -| `topics` | [*operations.Topics](../../models/operations/topics.md) | :heavy_minus_sign: | Filter destinations by supported topic(s). | -| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `tenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | +| `type_` | [*operations.ListTenantDestinationsType](../../models/operations/listtenantdestinationstype.md) | :heavy_minus_sign: | Filter destinations by type(s). | +| `topics` | [*operations.Topics](../../models/operations/topics.md) | :heavy_minus_sign: | Filter destinations by supported topic(s). | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -91,18 +93,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Create @@ -110,14 +103,14 @@ Creates a new destination for the tenant. The request body structure depends on ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -127,13 +120,13 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) res, err := s.Destinations.Create(ctx, components.CreateDestinationCreateRabbitmq( components.DestinationCreateRabbitMQ{ - ID: outpostgo.String("user-provided-id"), + ID: outpostgo.Pointer("user-provided-id"), Type: components.DestinationCreateRabbitMQTypeRabbitmq, Topics: components.CreateTopicsTopicsEnum( components.TopicsEnumWildcard, @@ -163,7 +156,7 @@ func main() { | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `destinationCreate` | [components.DestinationCreate](../../models/components/destinationcreate.md) | :heavy_check_mark: | N/A | +| `params` | [components.DestinationCreate](../../models/components/destinationcreate.md) | :heavy_check_mark: | N/A | | `tenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | @@ -173,18 +166,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Get @@ -192,14 +176,14 @@ Retrieves details for a specific destination. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -209,7 +193,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -238,18 +222,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Update @@ -257,14 +232,14 @@ Updates the configuration of an existing destination. The request body structure ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -274,7 +249,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -309,7 +284,7 @@ func main() { | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `destinationID` | *string* | :heavy_check_mark: | The ID of the destination. | -| `destinationUpdate` | [components.DestinationUpdate](../../models/components/destinationupdate.md) | :heavy_check_mark: | N/A | +| `params` | [components.DestinationUpdate](../../models/components/destinationupdate.md) | :heavy_check_mark: | N/A | | `tenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | @@ -319,18 +294,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Delete @@ -338,14 +304,14 @@ Deletes a specific destination. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -355,7 +321,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -384,18 +350,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Enable @@ -403,14 +360,14 @@ Enables a previously disabled destination. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -420,7 +377,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -449,18 +406,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Disable @@ -468,14 +416,14 @@ Disables a previously enabled destination. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -485,7 +433,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -514,15 +462,6 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sdks/outpost-go/docs/sdks/events/README.md b/sdks/outpost-go/docs/sdks/events/README.md index c4267e597..ae23c3481 100644 --- a/sdks/outpost-go/docs/sdks/events/README.md +++ b/sdks/outpost-go/docs/sdks/events/README.md @@ -1,5 +1,4 @@ # Events -(*Events*) ## Overview @@ -20,14 +19,14 @@ Retrieves a list of events for the tenant, supporting cursor navigation (details ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" "log" ) @@ -38,7 +37,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -66,18 +65,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Get @@ -85,14 +75,14 @@ Retrieves details for a specific event. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -102,7 +92,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -131,18 +121,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## ListDeliveries @@ -150,14 +131,14 @@ Retrieves a list of delivery attempts for a specific event, including response d ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -167,7 +148,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -196,18 +177,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## ListByDestination @@ -215,14 +187,14 @@ Retrieves events associated with a specific destination for the tenant. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" "log" ) @@ -233,7 +205,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -263,18 +235,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## GetByDestination @@ -282,14 +245,14 @@ Retrieves a specific event associated with a specific destination for the tenant ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -299,7 +262,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -329,18 +292,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Retry @@ -348,14 +302,14 @@ Triggers a retry for a failed event delivery. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -365,7 +319,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -395,15 +349,6 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sdks/outpost-go/docs/sdks/health/README.md b/sdks/outpost-go/docs/sdks/health/README.md index 04fafa26f..56cf1acd9 100644 --- a/sdks/outpost-go/docs/sdks/health/README.md +++ b/sdks/outpost-go/docs/sdks/health/README.md @@ -1,5 +1,4 @@ # Health -(*Health*) ## Overview @@ -11,7 +10,20 @@ API Health Check ## Check -Simple health check endpoint. +Health check endpoint that reports the status of all workers. + +Returns HTTP 200 when all workers are healthy, or HTTP 503 if any worker has failed. + +The response includes: +- `status`: Overall health status ("healthy" or "failed") +- `timestamp`: When this health check was performed (ISO 8601 format) +- `workers`: Map of worker names to their individual health status + +Each worker reports: +- `status`: Worker health ("healthy" or "failed") + +Note: Error details are not exposed for security reasons. Check application logs for detailed error information. + ### Example Usage @@ -34,7 +46,7 @@ func main() { if err != nil { log.Fatal(err) } - if res.Res != nil { + if res.Object != nil { // handle response } } diff --git a/sdks/outpost-go/docs/sdks/outpost/README.md b/sdks/outpost-go/docs/sdks/outpost/README.md deleted file mode 100644 index cc9ab457d..000000000 --- a/sdks/outpost-go/docs/sdks/outpost/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Outpost SDK - -## Overview - -Outpost API: The Outpost API is a REST-based JSON API for managing tenants, destinations, and publishing events. - -### Available Operations diff --git a/sdks/outpost-go/docs/sdks/publish/README.md b/sdks/outpost-go/docs/sdks/publish/README.md index 6bc5d3d3e..8a9c8428c 100644 --- a/sdks/outpost-go/docs/sdks/publish/README.md +++ b/sdks/outpost-go/docs/sdks/publish/README.md @@ -1,5 +1,4 @@ # Publish -(*Publish*) ## Overview @@ -21,8 +20,8 @@ package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -31,15 +30,15 @@ func main() { s := outpostgo.New( outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) res, err := s.Publish.Event(ctx, components.PublishRequest{ - ID: outpostgo.String("evt_custom_123"), - TenantID: outpostgo.String(""), - DestinationID: outpostgo.String(""), - Topic: outpostgo.String("topic.name"), + ID: outpostgo.Pointer("evt_custom_123"), + TenantID: outpostgo.Pointer(""), + DestinationID: outpostgo.Pointer(""), + Topic: outpostgo.Pointer("topic.name"), Metadata: map[string]string{ "source": "crm", }, diff --git a/sdks/outpost-go/docs/sdks/schemas/README.md b/sdks/outpost-go/docs/sdks/schemas/README.md index d1a940c9b..485c2310d 100644 --- a/sdks/outpost-go/docs/sdks/schemas/README.md +++ b/sdks/outpost-go/docs/sdks/schemas/README.md @@ -1,5 +1,4 @@ # Schemas -(*Schemas*) ## Overview @@ -18,14 +17,14 @@ Returns a list of JSON-based input schemas for each available destination type. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -35,7 +34,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -63,18 +62,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Get @@ -82,14 +72,14 @@ Returns the input schema for a specific destination type. Requires Admin API Key ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" "log" ) @@ -100,7 +90,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -129,18 +119,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## ListDestinationTypesJwt @@ -154,8 +135,8 @@ package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -164,7 +145,7 @@ func main() { s := outpostgo.New( outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -217,8 +198,8 @@ package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" "log" ) @@ -228,7 +209,7 @@ func main() { s := outpostgo.New( outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) diff --git a/sdks/outpost-go/docs/sdks/tenants/README.md b/sdks/outpost-go/docs/sdks/tenants/README.md index f27c65479..b408dac70 100644 --- a/sdks/outpost-go/docs/sdks/tenants/README.md +++ b/sdks/outpost-go/docs/sdks/tenants/README.md @@ -1,5 +1,4 @@ # Tenants -(*Tenants*) ## Overview @@ -10,26 +9,94 @@ If your system is not multi-tenant, create a single tenant with a hard-code tena ### Available Operations +* [ListTenants](#listtenants) - List Tenants * [Upsert](#upsert) - Create or Update Tenant * [Get](#get) - Get Tenant * [Delete](#delete) - Delete Tenant * [GetPortalURL](#getportalurl) - Get Portal Redirect URL * [GetToken](#gettoken) - Get Tenant JWT Token +## ListTenants + +List all tenants with cursor-based pagination. + +**Requirements:** This endpoint requires Redis with RediSearch module (e.g., `redis/redis-stack-server`). +If RediSearch is not available, this endpoint returns `501 Not Implemented`. + +The response includes lightweight tenant objects without computed fields like `destinations_count` and `topics`. +Use `GET /tenants/{tenant_id}` to retrieve full tenant details including these fields. + + +### Example Usage + + +```go +package main + +import( + "context" + "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" + "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" + "log" +) + +func main() { + ctx := context.Background() + + s := outpostgo.New( + outpostgo.WithSecurity(components.Security{ + AdminAPIKey: outpostgo.Pointer(""), + }), + ) + + res, err := s.Tenants.ListTenants(ctx, outpostgo.Pointer[int64](20), operations.OrderDesc.ToPointer(), nil, nil) + if err != nil { + log.Fatal(err) + } + if res.TenantListResponse != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `limit` | **int64* | :heavy_minus_sign: | Number of tenants to return per page (1-100, default 20). | +| `order` | [*operations.Order](../../models/operations/order.md) | :heavy_minus_sign: | Sort order by `created_at` timestamp. | +| `next` | **string* | :heavy_minus_sign: | Cursor for the next page of results. Mutually exclusive with `prev`. | +| `prev` | **string* | :heavy_minus_sign: | Cursor for the previous page of results. Mutually exclusive with `next`. | +| `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | + +### Response + +**[*operations.ListTenantsResponse](../../models/operations/listtenantsresponse.md), error** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| apierrors.ListTenantsBadRequestError | 400 | application/json | +| apierrors.NotImplementedError | 501 | application/json | +| apierrors.APIError | 4XX, 5XX | \*/\* | + ## Upsert Idempotently creates or updates a tenant. Required before associating destinations. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -39,11 +106,11 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) - res, err := s.Tenants.Upsert(ctx) + res, err := s.Tenants.Upsert(ctx, nil) if err != nil { log.Fatal(err) } @@ -59,6 +126,7 @@ func main() { | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `tenantID` | **string* | :heavy_minus_sign: | The ID of the tenant. Required when using AdminApiKey authentication. | +| `params` | [*components.TenantUpsert](../../models/components/tenantupsert.md) | :heavy_minus_sign: | Optional tenant metadata | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | ### Response @@ -67,19 +135,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.NotFoundError | 404 | application/json | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Get @@ -87,14 +145,14 @@ Retrieves details for a specific tenant. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -104,7 +162,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -132,18 +190,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## Delete @@ -151,14 +200,14 @@ Deletes the tenant and all associated destinations. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -168,7 +217,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -196,18 +245,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## GetPortalURL @@ -215,14 +255,14 @@ Returns a redirect URL containing a JWT to authenticate the user with the portal ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -232,7 +272,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -261,18 +301,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## GetToken @@ -280,14 +311,14 @@ Returns a JWT token scoped to the tenant for safe browser API calls. ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -297,7 +328,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -325,15 +356,6 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sdks/outpost-go/docs/sdks/topics/README.md b/sdks/outpost-go/docs/sdks/topics/README.md index 9da186cfb..f700935b1 100644 --- a/sdks/outpost-go/docs/sdks/topics/README.md +++ b/sdks/outpost-go/docs/sdks/topics/README.md @@ -1,5 +1,4 @@ # Topics -(*Topics*) ## Overview @@ -16,14 +15,14 @@ Returns a list of available event topics configured in the Outpost instance. Req ### Example Usage - + ```go package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -33,7 +32,7 @@ func main() { s := outpostgo.New( outpostgo.WithTenantID(""), outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) @@ -61,18 +60,9 @@ func main() { ### Errors -| Error Type | Status Code | Content Type | -| ----------------------------- | ----------------------------- | ----------------------------- | -| apierrors.UnauthorizedError | 401, 403, 407 | application/json | -| apierrors.TimeoutError | 408 | application/json | -| apierrors.RateLimitedError | 429 | application/json | -| apierrors.BadRequestError | 400, 413, 414, 415, 422, 431 | application/json | -| apierrors.TimeoutError | 504 | application/json | -| apierrors.NotFoundError | 501, 505 | application/json | -| apierrors.InternalServerError | 500, 502, 503, 506, 507, 508 | application/json | -| apierrors.BadRequestError | 510 | application/json | -| apierrors.UnauthorizedError | 511 | application/json | -| apierrors.APIError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| apierrors.APIError | 4XX, 5XX | \*/\* | ## ListJwt @@ -86,8 +76,8 @@ package main import( "context" - outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + outpostgo "github.com/hookdeck/outpost/sdks/outpost-go" "log" ) @@ -96,7 +86,7 @@ func main() { s := outpostgo.New( outpostgo.WithSecurity(components.Security{ - AdminAPIKey: outpostgo.String(""), + AdminAPIKey: outpostgo.Pointer(""), }), ) diff --git a/sdks/outpost-go/events.go b/sdks/outpost-go/events.go index 80d9a246a..b3abea62a 100644 --- a/sdks/outpost-go/events.go +++ b/sdks/outpost-go/events.go @@ -56,7 +56,7 @@ func (s *Events) List(ctx context.Context, request operations.ListTenantEventsRe } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/events", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/events", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -67,7 +67,7 @@ func (s *Events) List(ctx context.Context, request operations.ListTenantEventsRe BaseURL: baseURL, Context: ctx, OperationID: "listTenantEvents", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -89,7 +89,7 @@ func (s *Events) List(ctx context.Context, request operations.ListTenantEventsRe req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + if err := utils.PopulateQueryParams(ctx, req, request, globals, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -177,7 +177,7 @@ func (s *Events) List(ctx context.Context, request operations.ListTenantEventsRe _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -221,221 +221,6 @@ func (s *Events) List(ctx context.Context, request operations.ListTenantEventsRe } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -492,7 +277,7 @@ func (s *Events) Get(ctx context.Context, eventID string, tenantID *string, opts } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/events/{event_id}", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/events/{event_id}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -503,7 +288,7 @@ func (s *Events) Get(ctx context.Context, eventID string, tenantID *string, opts BaseURL: baseURL, Context: ctx, OperationID: "getTenantEvent", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -609,7 +394,7 @@ func (s *Events) Get(ctx context.Context, eventID string, tenantID *string, opts _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -653,264 +438,49 @@ func (s *Events) Get(ctx context.Context, eventID string, tenantID *string, opts } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: + case httpRes.StatusCode == 404: fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + return res, nil - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } +} - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } +// ListDeliveries - List Event Delivery Attempts +// Retrieves a list of delivery attempts for a specific event, including response details. +func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *string, opts ...operations.Option) (*operations.ListTenantEventDeliveriesResponse, error) { + request := operations.ListTenantEventDeliveriesRequest{ + TenantID: tenantID, + EventID: eventID, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + globals := operations.ListTenantEventDeliveriesGlobals{ + TenantID: s.sdkConfiguration.Globals.TenantID, + } - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// ListDeliveries - List Event Delivery Attempts -// Retrieves a list of delivery attempts for a specific event, including response details. -func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *string, opts ...operations.Option) (*operations.ListTenantEventDeliveriesResponse, error) { - request := operations.ListTenantEventDeliveriesRequest{ - TenantID: tenantID, - EventID: eventID, - } - - globals := operations.ListTenantEventDeliveriesGlobals{ - TenantID: s.sdkConfiguration.Globals.TenantID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } for _, opt := range opts { if err := opt(&o, supportedOptions...); err != nil { @@ -924,7 +494,7 @@ func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *s } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/events/{event_id}/deliveries", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/events/{event_id}/deliveries", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -935,7 +505,7 @@ func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *s BaseURL: baseURL, Context: ctx, OperationID: "listTenantEventDeliveries", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1041,676 +611,30 @@ func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *s _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.ListTenantEventDeliveriesResponse{ - HTTPMeta: components.HTTPMetadata{ - Request: req, - Response: httpRes, - }, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out []components.DeliveryAttempt - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.DeliveryAttempts = out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - fallthrough - case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) - } - - return res, nil - -} - -// ListByDestination - List Events by Destination -// Retrieves events associated with a specific destination for the tenant. -func (s *Events) ListByDestination(ctx context.Context, request operations.ListTenantEventsByDestinationRequest, opts ...operations.Option) (*operations.ListTenantEventsByDestinationResponse, error) { - globals := operations.ListTenantEventsByDestinationGlobals{ - TenantID: s.sdkConfiguration.Globals.TenantID, - } - - o := operations.Options{} - supportedOptions := []string{ - operations.SupportedOptionRetries, - operations.SupportedOptionTimeout, - } - - for _, opt := range opts { - if err := opt(&o, supportedOptions...); err != nil { - return nil, fmt.Errorf("error applying option: %w", err) - } - } - - var baseURL string - if o.ServerURL == nil { - baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - } else { - baseURL = *o.ServerURL - } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}/events", request, globals) - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) - } - - hookCtx := hooks.HookContext{ - SDK: s.rootSDK, - SDKConfiguration: s.sdkConfiguration, - BaseURL: baseURL, - Context: ctx, - OperationID: "listTenantEventsByDestination", - OAuth2Scopes: []string{}, - SecuritySource: s.sdkConfiguration.Security, - } - - timeout := o.Timeout - if timeout == nil { - timeout = s.sdkConfiguration.Timeout - } - - if timeout != nil { - var cancel context.CancelFunc - ctx, cancel = context.WithTimeout(ctx, *timeout) - defer cancel() - } - - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) - if err != nil { - return nil, fmt.Errorf("error creating request: %w", err) - } - req.Header.Set("Accept", "application/json") - req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - - if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { - return nil, err - } - - for k, v := range o.SetHeaders { - req.Header.Set(k, v) - } - - globalRetryConfig := s.sdkConfiguration.RetryConfig - retryConfig := o.Retries - if retryConfig == nil { - if globalRetryConfig != nil { - retryConfig = globalRetryConfig - } - } - - var httpRes *http.Response - if retryConfig != nil { - httpRes, err = utils.Retry(ctx, utils.Retries{ - Config: retryConfig, - StatusCodes: []string{ - "429", - "500", - "502", - "503", - "504", - }, - }, func() (*http.Response, error) { - if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { - copyBody, err := req.GetBody() - - if err != nil { - return nil, err - } - - req.Body = copyBody - } - - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.ListTenantEventsByDestinationResponse{ - HTTPMeta: components.HTTPMetadata{ - Request: req, - Response: httpRes, - }, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out operations.ListTenantEventsByDestinationResponseBody - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Object = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.ListTenantEventDeliveriesResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1718,12 +642,12 @@ func (s *Events) ListByDestination(ctx context.Context, request operations.ListT return nil, err } - var out apierrors.UnauthorizedError + var out []components.DeliveryAttempt if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.DeliveryAttempts = out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1757,16 +681,10 @@ func (s *Events) ListByDestination(ctx context.Context, request operations.ListT } -// GetByDestination - Get Event by Destination -// Retrieves a specific event associated with a specific destination for the tenant. -func (s *Events) GetByDestination(ctx context.Context, destinationID string, eventID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantEventByDestinationResponse, error) { - request := operations.GetTenantEventByDestinationRequest{ - TenantID: tenantID, - DestinationID: destinationID, - EventID: eventID, - } - - globals := operations.GetTenantEventByDestinationGlobals{ +// ListByDestination - List Events by Destination +// Retrieves events associated with a specific destination for the tenant. +func (s *Events) ListByDestination(ctx context.Context, request operations.ListTenantEventsByDestinationRequest, opts ...operations.Option) (*operations.ListTenantEventsByDestinationResponse, error) { + globals := operations.ListTenantEventsByDestinationGlobals{ TenantID: s.sdkConfiguration.Globals.TenantID, } @@ -1788,7 +706,7 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}/events/{event_id}", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}/events", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1798,8 +716,8 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getTenantEventByDestination", - OAuth2Scopes: []string{}, + OperationID: "listTenantEventsByDestination", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1821,6 +739,10 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, globals, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -1905,7 +827,7 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1920,7 +842,7 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve } } - res := &operations.GetTenantEventByDestinationResponse{ + res := &operations.ListTenantEventsByDestinationResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -1936,12 +858,12 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve return nil, err } - var out components.Event + var out operations.ListTenantEventsByDestinationResponseBody if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Event = &out + res.Object = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1949,201 +871,204 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: + case httpRes.StatusCode == 404: fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + return res, nil - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } +} - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } +// GetByDestination - Get Event by Destination +// Retrieves a specific event associated with a specific destination for the tenant. +func (s *Events) GetByDestination(ctx context.Context, destinationID string, eventID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantEventByDestinationResponse, error) { + request := operations.GetTenantEventByDestinationRequest{ + TenantID: tenantID, + DestinationID: destinationID, + EventID: eventID, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + globals := operations.GetTenantEventByDestinationGlobals{ + TenantID: s.sdkConfiguration.Globals.TenantID, + } - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}/events/{event_id}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getTenantEventByDestination", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err + if err != nil { + return nil, err + } + + req.Body = copyBody } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) if err != nil { - return nil, err + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) } - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) } + return httpRes, err + }) - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { if err != nil { - return nil, err + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.GetTenantEventByDestinationResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -2151,12 +1076,12 @@ func (s *Events) GetByDestination(ctx context.Context, destinationID string, eve return nil, err } - var out apierrors.UnauthorizedError + var out components.Event if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.Event = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -2221,7 +1146,7 @@ func (s *Events) Retry(ctx context.Context, destinationID string, eventID string } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destinations/{destination_id}/events/{event_id}/retry", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destinations/{destination_id}/events/{event_id}/retry", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -2232,7 +1157,7 @@ func (s *Events) Retry(ctx context.Context, destinationID string, eventID string BaseURL: baseURL, Context: ctx, OperationID: "retryTenantEvent", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -2251,7 +1176,7 @@ func (s *Events) Retry(ctx context.Context, destinationID string, eventID string if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json") + req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { @@ -2338,7 +1263,7 @@ func (s *Events) Retry(ctx context.Context, destinationID string, eventID string _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "409", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "409", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -2362,221 +1287,6 @@ func (s *Events) Retry(ctx context.Context, destinationID string, eventID string switch { case httpRes.StatusCode == 202: - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode == 409: diff --git a/sdks/outpost-go/go.mod b/sdks/outpost-go/go.mod index 9552f994b..5dd9b9351 100644 --- a/sdks/outpost-go/go.mod +++ b/sdks/outpost-go/go.mod @@ -2,4 +2,10 @@ module github.com/hookdeck/outpost/sdks/outpost-go go 1.22 -require github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 +require github.com/stretchr/testify v1.11.1 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/sdks/outpost-go/go.sum b/sdks/outpost-go/go.sum index c5a75f1b8..c4c1710c4 100644 --- a/sdks/outpost-go/go.sum +++ b/sdks/outpost-go/go.sum @@ -1,2 +1,10 @@ -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= -github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdks/outpost-go/health.go b/sdks/outpost-go/health.go index c9b9c95dd..e8f7dd3e3 100644 --- a/sdks/outpost-go/health.go +++ b/sdks/outpost-go/health.go @@ -33,7 +33,19 @@ func newHealth(rootSDK *Outpost, sdkConfig config.SDKConfiguration, hooks *hooks } // Health Check -// Simple health check endpoint. +// Health check endpoint that reports the status of all workers. +// +// Returns HTTP 200 when all workers are healthy, or HTTP 503 if any worker has failed. +// +// The response includes: +// - `status`: Overall health status ("healthy" or "failed") +// - `timestamp`: When this health check was performed (ISO 8601 format) +// - `workers`: Map of worker names to their individual health status +// +// Each worker reports: +// - `status`: Worker health ("healthy" or "failed") +// +// Note: Error details are not exposed for security reasons. Check application logs for detailed error information. func (s *Health) Check(ctx context.Context, opts ...operations.Option) (*operations.HealthCheckResponse, error) { o := operations.Options{} supportedOptions := []string{ @@ -64,7 +76,7 @@ func (s *Health) Check(ctx context.Context, opts ...operations.Option) (*operati BaseURL: baseURL, Context: ctx, OperationID: "healthCheck", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: nil, } @@ -83,7 +95,7 @@ func (s *Health) Check(ctx context.Context, opts ...operations.Option) (*operati if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "text/plain") + req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) for k, v := range o.SetHeaders { @@ -191,14 +203,18 @@ func (s *Health) Check(ctx context.Context, opts ...operations.Option) (*operati switch { case httpRes.StatusCode == 200: switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `text/plain`): + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { return nil, err } - out := string(rawBody) - res.Res = &out + var out operations.HealthCheckResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/sdks/outpost-go/internal/globals/globals.go b/sdks/outpost-go/internal/globals/globals.go index 89e9bd328..7d6947262 100644 --- a/sdks/outpost-go/internal/globals/globals.go +++ b/sdks/outpost-go/internal/globals/globals.go @@ -6,9 +6,9 @@ type Globals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *Globals) GetTenantID() *string { - if o == nil { +func (g *Globals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } diff --git a/sdks/outpost-go/internal/utils/form.go b/sdks/outpost-go/internal/utils/form.go index d2be51d09..33162f7fc 100644 --- a/sdks/outpost-go/internal/utils/form.go +++ b/sdks/outpost-go/internal/utils/form.go @@ -10,18 +10,19 @@ import ( "strings" "time" - "github.com/ericlagergren/decimal" - + "github.com/hookdeck/outpost/sdks/outpost-go/optionalnullable" "github.com/hookdeck/outpost/sdks/outpost-go/types" ) -func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string, getFieldName func(reflect.StructField) string) url.Values { +func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string, allowEmptyValue map[string]struct{}, getFieldName func(reflect.StructField) string) url.Values { formValues := url.Values{} if isNil(objType, objValue) { if defaultValue != nil { formValues.Add(paramName, *defaultValue) + } else if _, ok := allowEmptyValue[paramName]; ok { + formValues.Add(paramName, "") } return formValues @@ -41,8 +42,6 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue formValues.Add(paramName, valToString(objValue.Interface())) case big.Int: formValues.Add(paramName, valToString(objValue.Interface())) - case decimal.Big: - formValues.Add(paramName, valToString(objValue.Interface())) default: var items []string @@ -64,7 +63,13 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue } if explode { - formValues.Add(fieldName, valToString(valType.Interface())) + if valType.Kind() == reflect.Slice || valType.Kind() == reflect.Array { + for i := 0; i < valType.Len(); i++ { + formValues.Add(fieldName, valToString(valType.Index(i).Interface())) + } + } else { + formValues.Add(fieldName, valToString(valType.Interface())) + } } else { items = append(items, fmt.Sprintf("%s%s%s", fieldName, delimiter, valToString(valType.Interface()))) } @@ -75,6 +80,16 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue } } case reflect.Map: + // check if optionalnullable.OptionalNullable[T] + if nullableValue, ok := optionalnullable.AsOptionalNullable(objValue); ok { + // Handle optionalnullable.OptionalNullable[T] using GetUntyped method + if value, isSet := nullableValue.GetUntyped(); isSet && value != nil { + formValues.Add(paramName, valToString(value)) + } + // If not set or explicitly null, skip adding to form + return formValues + } + items := []string{} iter := objValue.MapRange() @@ -90,12 +105,31 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue formValues.Add(paramName, strings.Join(items, delimiter)) } case reflect.Slice, reflect.Array: - values := parseDelimitedArray(explode, objValue, delimiter) - for _, v := range values { - formValues.Add(paramName, v) + if objValue.Len() == 0 { + if _, ok := allowEmptyValue[paramName]; ok { + formValues.Add(paramName, "") + } + } else { + values := parseDelimitedArray(explode, objValue, delimiter) + for _, v := range values { + formValues.Add(paramName, v) + } } default: - formValues.Add(paramName, valToString(objValue.Interface())) + // For string types, use the value directly without conversion + if objType.Kind() == reflect.String { + stringValue := objValue.String() + formValues.Add(paramName, stringValue) + } else { + stringValue := valToString(objValue.Interface()) + if stringValue == "" { + if _, ok := allowEmptyValue[paramName]; ok { + formValues.Add(paramName, "") + } + } else if stringValue != "" { + formValues.Add(paramName, stringValue) + } + } } return formValues diff --git a/sdks/outpost-go/internal/utils/headers.go b/sdks/outpost-go/internal/utils/headers.go index a07608bdc..dc9e1fde9 100644 --- a/sdks/outpost-go/internal/utils/headers.go +++ b/sdks/outpost-go/internal/utils/headers.go @@ -8,6 +8,8 @@ import ( "net/http" "reflect" "strings" + + "github.com/hookdeck/outpost/sdks/outpost-go/optionalnullable" ) func PopulateHeaders(_ context.Context, req *http.Request, headers interface{}, globals interface{}) { @@ -98,6 +100,16 @@ func serializeHeader(objType reflect.Type, objValue reflect.Value, explode bool) return strings.Join(items, ",") case reflect.Map: + // check if optionalnullable.OptionalNullable[T] + if nullableValue, ok := optionalnullable.AsOptionalNullable(objValue); ok { + // Handle optionalnullable.OptionalNullable[T] using GetUntyped method + if value, isSet := nullableValue.GetUntyped(); isSet && value != nil { + return valToString(value) + } + // If not set or explicitly null, return empty string + return "" + } + items := []string{} iter := objValue.MapRange() diff --git a/sdks/outpost-go/internal/utils/json.go b/sdks/outpost-go/internal/utils/json.go index ceb63a650..3e1150a49 100644 --- a/sdks/outpost-go/internal/utils/json.go +++ b/sdks/outpost-go/internal/utils/json.go @@ -15,20 +15,31 @@ import ( "unsafe" "github.com/hookdeck/outpost/sdks/outpost-go/types" - - "github.com/ericlagergren/decimal" ) func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { - typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + // Handle nil interface early + if v == nil { + return []byte("null"), nil + } + + // Check for nil pointer before dereferencing to avoid creating invalid reflect.Value + origVal := reflect.ValueOf(v) + if origVal.Kind() == reflect.Ptr && origVal.IsNil() { + return []byte("null"), nil + } + + typ, val := dereferencePointers(reflect.TypeOf(v), origVal) switch { case isModelType(typ): - if topLevel { + // When topLevel=true, only use json.Marshal if the type has a custom MarshalJSON + // to ensure nested structs with custom tags (like integer:"string") are handled correctly + if topLevel && implementsJSONMarshaler(v) { return json.Marshal(v) } - if isNil(typ, val) { + if isNil(typ, val) || !val.IsValid() { return []byte("null"), nil } @@ -41,21 +52,30 @@ func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, e fieldName := field.Name omitEmpty := false + omitZero := false jsonTag := field.Tag.Get("json") if jsonTag != "" { for _, tag := range strings.Split(jsonTag, ",") { if tag == "omitempty" { omitEmpty = true + } else if tag == "omitzero" { + omitZero = true } else { fieldName = tag } } } - if isNil(field.Type, fieldVal) && field.Tag.Get("const") == "" { - if omitEmpty { + if (omitEmpty || omitZero) && field.Tag.Get("const") == "" { + // Both omitempty and omitzero skip zero values (including nil) + if isNil(field.Type, fieldVal) { continue } + + if omitZero && fieldVal.IsZero() { + continue + } + } if !field.IsExported() && field.Tag.Get("const") == "" { @@ -124,7 +144,12 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool switch { case isModelType(typ): - if topLevel || bytes.Equal(b, []byte("null")) { + if bytes.Equal(b, []byte("null")) { + return json.Unmarshal(b, v) + } + // When topLevel=true, only use json.Unmarshal if the type has a custom UnmarshalJSON + // to ensure nested structs with custom tags (like integer:"string") are handled correctly + if topLevel && implementsJSONUnmarshaler(reflect.TypeOf(v)) { return json.Unmarshal(b, v) } @@ -156,7 +181,7 @@ func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool jsonTag := field.Tag.Get("json") if jsonTag != "" { for _, tag := range strings.Split(jsonTag, ",") { - if tag != "omitempty" { + if tag != "omitempty" && tag != "omitzero" { fieldName = tag } } @@ -287,6 +312,11 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) return []byte("null"), nil } + // Check if the map implements json.Marshaler (like optionalnullable.OptionalNullable[T]) + if marshaler, ok := val.Interface().(json.Marshaler); ok { + return marshaler.MarshalJSON() + } + out := map[string]json.RawMessage{} for _, key := range val.MapKeys() { @@ -340,16 +370,11 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) b := val.Interface().(big.Int) return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil } - case reflect.TypeOf(decimal.Big{}): - format := tag.Get("decimal") - if format == "number" { - b := val.Interface().(decimal.Big) - f, ok := (&b).Float64() - if ok { - return []byte(b.String()), nil - } - - return []byte(fmt.Sprintf(`%f`, f)), nil + default: + // For model types without custom MarshalJSON, use field processing + // to handle custom tags like integer:"string" + if isModelType(typ) && !implementsJSONMarshaler(v) { + return MarshalJSON(v, "", false) } } } @@ -357,6 +382,24 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) return json.Marshal(v) } +func implementsJSONMarshaler(v interface{}) bool { + marshalerType := reflect.TypeOf((*json.Marshaler)(nil)).Elem() + vType := reflect.TypeOf(v) + if vType.Implements(marshalerType) { + return true + } + if vType.Kind() == reflect.Ptr { + // For double pointers (e.g., **TypeA), check if the inner pointer type + // implements the interface (e.g., *TypeA) + if vType.Elem().Implements(marshalerType) { + return true + } + // Also check if pointer to element implements it + return reflect.PtrTo(vType.Elem()).Implements(marshalerType) + } + return reflect.PtrTo(vType).Implements(marshalerType) +} + func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { if tagValue == "null" { return []byte("null") @@ -381,11 +424,6 @@ func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.Struc if format == "string" { return []byte(fmt.Sprintf(`"%s"`, tagValue)) } - case reflect.TypeOf(decimal.Big{}): - decimalTag := tag.Get("decimal") - if decimalTag != "number" { - return []byte(fmt.Sprintf(`"%s"`, tagValue)) - } case reflect.TypeOf(types.Date{}): return []byte(fmt.Sprintf(`"%s"`, tagValue)) default: @@ -566,27 +604,6 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa v.Set(reflect.ValueOf(b)) return nil - case reflect.TypeOf(decimal.Big{}): - var d *decimal.Big - format := tag.Get("decimal") - if format == "number" { - var ok bool - d, ok = new(decimal.Big).SetString(string(value)) - if !ok { - return fmt.Errorf("failed to parse number as decimal.Big") - } - } else { - if err := json.Unmarshal(value, &d); err != nil { - return err - } - } - - if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { - v = v.Elem() - } - - v.Set(reflect.ValueOf(d)) - return nil case reflect.TypeOf(types.Date{}): var s string @@ -608,6 +625,31 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa v.Set(reflect.ValueOf(d)) return nil + default: + // For model types without custom UnmarshalJSON, use field processing + // to handle custom tags like integer:"string" + if isModelType(typ) && !implementsJSONUnmarshaler(v.Type()) { + // If v is already a pointer, we can unmarshal directly into it + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + // Handle double pointers (e.g., **Struct for nullable array elements) + inner := v.Elem() + if inner.Kind() == reflect.Ptr { + if inner.IsNil() { + inner.Set(reflect.New(typ)) + } + return UnmarshalJSON(value, inner.Interface(), "", false, nil) + } + return UnmarshalJSON(value, v.Interface(), "", false, nil) + } + // For non-pointer struct values that are addressable + if v.CanAddr() { + return UnmarshalJSON(value, v.Addr().Interface(), "", false, nil) + } + // For non-addressable struct values, fall through to json.Unmarshal + } } } @@ -622,6 +664,23 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa return json.Unmarshal(value, val) } +func implementsJSONUnmarshaler(typ reflect.Type) bool { + unmarshalerType := reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() + if typ.Implements(unmarshalerType) { + return true + } + if typ.Kind() == reflect.Ptr { + // For double pointers (e.g., **TypeA), check if the inner pointer type + // implements the interface (e.g., *TypeA) + if typ.Elem().Implements(unmarshalerType) { + return true + } + // Also check if pointer to element implements it + return reflect.PtrTo(typ.Elem()).Implements(unmarshalerType) + } + return reflect.PtrTo(typ).Implements(unmarshalerType) +} + func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { if typ.Kind() == reflect.Ptr { typ = typ.Elem() @@ -651,8 +710,6 @@ func isComplexValueType(typ reflect.Type) bool { fallthrough case reflect.TypeOf(big.Int{}): fallthrough - case reflect.TypeOf(decimal.Big{}): - fallthrough case reflect.TypeOf(types.Date{}): return true } diff --git a/sdks/outpost-go/internal/utils/pathparams.go b/sdks/outpost-go/internal/utils/pathparams.go index b1130a0ab..78542fc1c 100644 --- a/sdks/outpost-go/internal/utils/pathparams.go +++ b/sdks/outpost-go/internal/utils/pathparams.go @@ -11,8 +11,7 @@ import ( "strings" "time" - "github.com/ericlagergren/decimal" - + "github.com/hookdeck/outpost/sdks/outpost-go/optionalnullable" "github.com/hookdeck/outpost/sdks/outpost-go/types" ) @@ -114,6 +113,16 @@ func getSimplePathParams(parentName string, objType reflect.Type, objValue refle } pathParams[parentName] = strings.Join(ppVals, ",") case reflect.Map: + // check if optionalnullable.OptionalNullable[T] + if nullableValue, ok := optionalnullable.AsOptionalNullable(objValue); ok { + // Handle optionalnullable.OptionalNullable[T] using GetUntyped method + if value, isSet := nullableValue.GetUntyped(); isSet && value != nil { + pathParams[parentName] = valToString(value) + } + // If not set or explicitly null, return nil (skip parameter) + return pathParams + } + if objValue.Len() == 0 { return nil } @@ -135,8 +144,6 @@ func getSimplePathParams(parentName string, objType reflect.Type, objValue refle pathParams[parentName] = valToString(objValue.Interface()) case big.Int: pathParams[parentName] = valToString(objValue.Interface()) - case decimal.Big: - pathParams[parentName] = valToString(objValue.Interface()) default: var ppVals []string for i := 0; i < objType.NumField(); i++ { diff --git a/sdks/outpost-go/internal/utils/queryparams.go b/sdks/outpost-go/internal/utils/queryparams.go index 6234fe7ed..5143c4f03 100644 --- a/sdks/outpost-go/internal/utils/queryparams.go +++ b/sdks/outpost-go/internal/utils/queryparams.go @@ -12,12 +12,11 @@ import ( "reflect" "time" - "github.com/ericlagergren/decimal" - + "github.com/hookdeck/outpost/sdks/outpost-go/optionalnullable" "github.com/hookdeck/outpost/sdks/outpost-go/types" ) -func PopulateQueryParams(_ context.Context, req *http.Request, queryParams interface{}, globals interface{}) error { +func PopulateQueryParams(_ context.Context, req *http.Request, queryParams interface{}, globals interface{}, allowEmptyValue map[string]struct{}) error { // Query parameters may already be present from overriding URL if req.URL.RawQuery != "" { return nil @@ -25,13 +24,13 @@ func PopulateQueryParams(_ context.Context, req *http.Request, queryParams inter values := url.Values{} - globalsAlreadyPopulated, err := populateQueryParams(queryParams, globals, values, []string{}) + globalsAlreadyPopulated, err := populateQueryParams(queryParams, globals, values, []string{}, allowEmptyValue) if err != nil { return err } if globals != nil { - _, err = populateQueryParams(globals, nil, values, globalsAlreadyPopulated) + _, err = populateQueryParams(globals, nil, values, globalsAlreadyPopulated, allowEmptyValue) if err != nil { return err } @@ -42,11 +41,14 @@ func PopulateQueryParams(_ context.Context, req *http.Request, queryParams inter return nil } -func populateQueryParams(queryParams interface{}, globals interface{}, values url.Values, skipFields []string) ([]string, error) { - queryParamsStructType, queryParamsValType := dereferencePointers(reflect.TypeOf(queryParams), reflect.ValueOf(queryParams)) +func populateQueryParams(queryParams interface{}, globals interface{}, values url.Values, skipFields []string, allowEmptyValue map[string]struct{}) ([]string, error) { + queryParamsVal := reflect.ValueOf(queryParams) + if queryParamsVal.Kind() == reflect.Pointer && queryParamsVal.IsNil() { + return nil, nil + } + queryParamsStructType, queryParamsValType := dereferencePointers(reflect.TypeOf(queryParams), queryParamsVal) globalsAlreadyPopulated := []string{} - for i := 0; i < queryParamsStructType.NumField(); i++ { fieldType := queryParamsStructType.Field(i) valType := queryParamsValType.Field(i) @@ -99,14 +101,14 @@ func populateQueryParams(queryParams interface{}, globals interface{}, values ur } } case "form": - vals := populateFormParams(qpTag, fieldType.Type, valType, ",", defaultValue) + vals := populateFormParams(qpTag, fieldType.Type, valType, ",", defaultValue, allowEmptyValue) for k, v := range vals { for _, vv := range v { values.Add(k, vv) } } case "pipeDelimited": - vals := populateFormParams(qpTag, fieldType.Type, valType, "|", defaultValue) + vals := populateFormParams(qpTag, fieldType.Type, valType, "|", defaultValue, allowEmptyValue) for k, v := range vals { for _, vv := range v { values.Add(k, vv) @@ -157,6 +159,16 @@ func populateDeepObjectParams(tag *paramTag, objType reflect.Type, objValue refl switch objValue.Kind() { case reflect.Map: + // check if optionalnullable.OptionalNullable[T] + if nullableValue, ok := optionalnullable.AsOptionalNullable(objValue); ok { + // Handle optionalnullable.OptionalNullable[T] using GetUntyped method + if value, isSet := nullableValue.GetUntyped(); isSet && value != nil { + values.Add(tag.ParamName, valToString(value)) + } + // If not set or explicitly null, skip adding to values + return values + } + populateDeepObjectParamsMap(values, tag.ParamName, objValue) case reflect.Struct: populateDeepObjectParamsStruct(values, tag.ParamName, objValue) @@ -235,7 +247,7 @@ func populateDeepObjectParamsStruct(qsValues url.Values, priorScope string, stru populateDeepObjectParamsMap(qsValues, scope, fieldValue) case reflect.Struct: switch fieldValue.Type() { - case reflect.TypeOf(big.Int{}), reflect.TypeOf(decimal.Big{}), reflect.TypeOf(time.Time{}), reflect.TypeOf(types.Date{}): + case reflect.TypeOf(big.Int{}), reflect.TypeOf(time.Time{}), reflect.TypeOf(types.Date{}): qsValues.Add(scope, valToString(fieldValue.Interface())) continue @@ -248,13 +260,20 @@ func populateDeepObjectParamsStruct(qsValues url.Values, priorScope string, stru } } -func populateFormParams(tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string) url.Values { - return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, defaultValue, func(fieldType reflect.StructField) string { +func populateFormParams(tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string, allowEmptyValue map[string]struct{}) url.Values { + return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, defaultValue, allowEmptyValue, func(fieldType reflect.StructField) string { qpTag := parseQueryParamTag(fieldType) if qpTag == nil { return "" } + // When inline is true, use the parent's param name instead of the field's own name. + // This allows union/oneOf wrapper types to serialize their values directly under + // the parent's query parameter name. + if qpTag.Inline { + return tag.ParamName + } + return qpTag.ParamName }) } diff --git a/sdks/outpost-go/internal/utils/requestbody.go b/sdks/outpost-go/internal/utils/requestbody.go index 8622ec586..b391f6009 100644 --- a/sdks/outpost-go/internal/utils/requestbody.go +++ b/sdks/outpost-go/internal/utils/requestbody.go @@ -14,6 +14,8 @@ import ( "path/filepath" "reflect" "regexp" + + "github.com/hookdeck/outpost/sdks/outpost-go/optionalnullable" ) const ( @@ -23,9 +25,9 @@ const ( ) var ( - jsonEncodingRegex = regexp.MustCompile(`(application|text)\/.*?\+*json.*`) - multipartEncodingRegex = regexp.MustCompile(`multipart\/.*`) - urlEncodedEncodingRegex = regexp.MustCompile(`application\/x-www-form-urlencoded.*`) + jsonEncodingRegex = regexp.MustCompile(`^(application|text)\/([^+]+\+)*json.*`) + multipartEncodingRegex = regexp.MustCompile(`^multipart\/.*`) + urlEncodedEncodingRegex = regexp.MustCompile(`^application\/x-www-form-urlencoded.*`) ) func SerializeRequestBody(_ context.Context, request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { @@ -205,7 +207,7 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { case reflect.Slice, reflect.Array: values := parseDelimitedArray(true, valType, ",") for _, v := range values { - if err := writer.WriteField(tag.Name+"[]", v); err != nil { + if err := writer.WriteField(tag.Name, v); err != nil { writer.Close() return "", err } @@ -323,7 +325,7 @@ func encodeFormData(fieldName string, w io.Writer, data interface{}) error { switch tag.Style { // TODO: support other styles case "form": - values := populateForm(tag.Name, tag.Explode, fieldType, valType, ",", nil, func(sf reflect.StructField) string { + values := populateForm(tag.Name, tag.Explode, fieldType, valType, ",", nil, nil, func(sf reflect.StructField) string { tag := parseFormTag(field) if tag == nil { return "" @@ -340,6 +342,17 @@ func encodeFormData(fieldName string, w io.Writer, data interface{}) error { } } case reflect.Map: + // check if optionalnullable.OptionalNullable[T] + if nullableValue, ok := optionalnullable.AsOptionalNullable(requestValType); ok { + // Handle optionalnullable.OptionalNullable[T] using GetUntyped method + if value, isSet := nullableValue.GetUntyped(); isSet && value != nil { + dataValues.Set(fieldName, valToString(value)) + } + // If not set or explicitly null, skip adding to form + break + } + + // Handle regular map for _, k := range requestValType.MapKeys() { v := requestValType.MapIndex(k) dataValues.Set(fmt.Sprintf("%v", k.Interface()), valToString(v.Interface())) diff --git a/sdks/outpost-go/internal/utils/union.go b/sdks/outpost-go/internal/utils/union.go new file mode 100644 index 000000000..dfff6f64f --- /dev/null +++ b/sdks/outpost-go/internal/utils/union.go @@ -0,0 +1,289 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package utils + +import ( + "encoding/json" + "math/big" + "reflect" + "strings" + "time" + + "github.com/hookdeck/outpost/sdks/outpost-go/types" +) + +// UnionCandidate represents a candidate type during union deserialization +type UnionCandidate struct { + Matched int // Count of matched fields (includes inexact) + Inexact int // Count of fields with unknown/unrecognized enum values + Unmatched int // Count of struct fields not found in raw JSON + AdditionalProperties int // Count of fields captured by additionalProperties + Type any // The union type enum value + Value any // The unmarshaled value +} + +// PickBestUnionCandidate selects the best union type candidate according to `betterCandidate` +func PickBestUnionCandidate(candidates []UnionCandidate, rawJSON []byte) *UnionCandidate { + if len(candidates) == 0 { + return nil + } + + if len(candidates) == 1 { + return &candidates[0] + } + + var raw any + _ = json.Unmarshal(rawJSON, &raw) + + var best *UnionCandidate + for i := range candidates { + countFields(&candidates[i], raw) + best = betterCandidate(best, &candidates[i]) + } + return best +} + +// betterCandidate returns the better of two candidates based on: +// 1. Matched count (higher is better) +// 2. Inexact count (lower is better) +// 3. Unmatched count (lower is better - fewer zero defaulted values) +// 4. AdditionalProperties count (higher is better - captures more extra fields) +// Returns a if tied (preserving spec order). +func betterCandidate(a, b *UnionCandidate) *UnionCandidate { + if a == nil { + return b + } + if b == nil { + return a + } + if a.Matched != b.Matched { + if a.Matched > b.Matched { + return a + } + return b + } + if a.Inexact != b.Inexact { + if a.Inexact > b.Inexact { + return b + } + return a + } + if a.Unmatched != b.Unmatched { + if a.Unmatched > b.Unmatched { + return b + } + return a + } + if a.AdditionalProperties != b.AdditionalProperties { + if a.AdditionalProperties > b.AdditionalProperties { + return a + } + return b + } + return a +} + +// countFields populates UnionCandidate.Matched, UnionCandidate.Inexact, and UnionCandidate.Unmatched fields +func countFields(candidate *UnionCandidate, raw any) { + typ := reflect.TypeOf(candidate.Value) + val := reflect.ValueOf(candidate.Value) + countFieldsRecursive(candidate, typ, val, raw) +} + +func countFieldsRecursive(candidate *UnionCandidate, typ reflect.Type, val reflect.Value, raw any) { + kind := typ.Kind() + + // Handle interface{}/any types - can hold any JSON value + if kind == reflect.Interface { + candidate.Matched++ + return + } + + if typ.Kind() == reflect.Ptr { + if raw == nil { + // Handle null JSON value match + candidate.Matched++ + return + } + typ, val = dereferencePointers(typ, val) + kind = typ.Kind() + } + + // Handle primitives + if kind == reflect.String || + kind == reflect.Bool || + kind == reflect.Int || kind == reflect.Int8 || kind == reflect.Int16 || kind == reflect.Int32 || kind == reflect.Int64 || + kind == reflect.Uint || kind == reflect.Uint8 || kind == reflect.Uint16 || kind == reflect.Uint32 || kind == reflect.Uint64 || + kind == reflect.Float32 || kind == reflect.Float64 || + typ == reflect.TypeOf(time.Time{}) || + typ == reflect.TypeOf(big.Int{}) || + typ == reflect.TypeOf(types.Date{}) || + typ == reflect.TypeOf([]byte{}) { + candidate.Matched++ + if !isExact(val) || raw == nil { + candidate.Inexact++ + } + return + } + + // Handle unions + if isUnion, activeVariant, variantVal := findActiveUnionVariant(typ, val); isUnion { + if activeVariant != nil && !variantVal.IsNil() { + countFieldsRecursive(candidate, activeVariant.Type.Elem(), variantVal.Elem(), raw) + } + return + } + + // Handle regular structs + if kind == reflect.Struct { + rawObj, ok := raw.(map[string]any) + if !ok { + return + } + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + if field.Tag.Get("additionalProperties") == "true" { + if field.Type.Kind() == reflect.Map && !fieldVal.IsNil() { + candidate.AdditionalProperties += fieldVal.Len() + } + continue + } + + jsonName, ok := jsonFieldName(field) + if !ok { + continue + } + + rawField, exists := rawObj[jsonName] + if !exists { + candidate.Unmatched++ + continue + } + + countFieldsRecursive(candidate, field.Type, fieldVal, rawField) + } + return + } + + // Handle slices and arrays + if kind == reflect.Slice || kind == reflect.Array { + if val.IsNil() || val.Len() == 0 { + return + } + + rawArr, ok := raw.([]any) + if !ok { + return + } + + // Count each array/slice element + for i := 0; i < val.Len() && i < len(rawArr); i++ { + itemVal := val.Index(i) + countFieldsRecursive(candidate, itemVal.Type(), itemVal, rawArr[i]) + } + return + } + + // Handle maps + if kind == reflect.Map { + if val.IsNil() || val.Len() == 0 { + return + } + + rawObj, ok := raw.(map[string]any) + if !ok { + return + } + + for _, key := range val.MapKeys() { + keyStr := key.String() + rawVal, exists := rawObj[keyStr] + if exists { + mapVal := val.MapIndex(key) + countFieldsRecursive(candidate, mapVal.Type(), mapVal, rawVal) + } + } + return + } + // Anything else + candidate.Matched++ + return +} + +// jsonFieldName returns the JSON field name for a struct field. +// Returns ("", false) if the field should be skipped (json:"-"). +func jsonFieldName(field reflect.StructField) (string, bool) { + jsonTag := field.Tag.Get("json") + if jsonTag == "-" { + return "", false + } + if jsonTag != "" { + parts := strings.Split(jsonTag, ",") + if parts[0] != "" { + return parts[0], true + } + } + return field.Name, true +} + +// findActiveUnionVariant detects if a struct is a union type and returns the active variant. +// A union type is detected by having fields with the `union:"member"` tag. +// Returns (false, nil, invalid) if not a union type. +// Returns (true, nil, invalid) if union type but no active variant found (all nil). +// Returns (true, field, value) if union type with an active variant. +func findActiveUnionVariant(typ reflect.Type, val reflect.Value) (bool, *reflect.StructField, reflect.Value) { + if typ.Kind() != reflect.Struct { + return false, nil, reflect.Value{} + } + + var activeVariant *reflect.StructField + var activeValue reflect.Value + isUnion := false + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + + // Look for fields tagged as union members + if field.Tag.Get("union") != "member" { + continue + } + + isUnion = true + + // All union variants are pointers - only set active if non-nil + fieldVal := val.Field(i) + if !fieldVal.IsNil() { + activeVariant = &field + activeValue = fieldVal + } + } + + return isUnion, activeVariant, activeValue +} + +func isExact(val reflect.Value) bool { + if !val.IsValid() { + return true + } + + // If not addressable, make an addressable copy + if !val.CanAddr() && val.CanInterface() { + ptr := reflect.New(val.Type()) + ptr.Elem().Set(val) + val = ptr.Elem() + } + + if val.CanInterface() && val.CanAddr() { + ptrVal := val.Addr() + if method := ptrVal.MethodByName("IsExact"); method.IsValid() { + results := method.Call(nil) + if len(results) == 1 && results[0].Kind() == reflect.Bool { + return results[0].Bool() + } + } + } + return true +} diff --git a/sdks/outpost-go/internal/utils/union_test.go b/sdks/outpost-go/internal/utils/union_test.go new file mode 100644 index 000000000..f66814c73 --- /dev/null +++ b/sdks/outpost-go/internal/utils/union_test.go @@ -0,0 +1,587 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package utils + +import ( + "encoding/json" + "reflect" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// makeCandidates unmarshals payload into each type and returns candidates +func makeCandidates(t *testing.T, payload string, types ...any) []UnionCandidate { + t.Helper() + candidates := make([]UnionCandidate, len(types)) + for i, typ := range types { + val := reflect.New(reflect.TypeOf(typ)).Interface() + require.NoError(t, UnmarshalJSON([]byte(payload), val, "", false, nil)) + candidates[i] = UnionCandidate{Type: typ, Value: reflect.ValueOf(val).Elem().Interface()} + } + return candidates +} + +func TestPickBestUnionCandidate_SelectsTypeWithMoreMatchedFields(t *testing.T) { + type A struct { + Foo string `json:"foo"` + } + type B struct { + Foo string `json:"foo"` + Bar string `json:"bar"` + } + + payload := `{"foo": "", "bar": ""}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_EmptyCandidates(t *testing.T) { + result := PickBestUnionCandidate([]UnionCandidate{}, []byte(`{"foo": "test"}`)) + assert.Nil(t, result) +} + +func TestPickBestUnionCandidate_PrefersFewerUnmatchedFields(t *testing.T) { + type A struct { + Foo string `json:"foo"` + Bar string `json:"bar"` // not in payload + } + type B struct { + Foo string `json:"foo"` + } + + payload := `{"foo": "test"}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) // fewer unmatched fields +} + +func TestPickBestUnionCandidate_NestedStructs(t *testing.T) { + type InnerA struct { + Value string `json:"value"` + } + type InnerB struct { + Value string `json:"value"` + Extra string `json:"extra"` + } + type A struct { + Nested InnerA `json:"nested"` + } + type B struct { + Nested InnerB `json:"nested"` + } + + payload := `{"nested": {"value": "test", "extra": "data"}}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_ArrayFields(t *testing.T) { + type ItemA struct { + Name string `json:"name"` + } + type ItemB struct { + Name string `json:"name"` + Value string `json:"value"` + } + type A = []ItemA + type B = []ItemB + + payload := `[{"name": "a", "value": "1"}, {"name": "b", "value": "2"}]` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_PreservesOrderOnTie(t *testing.T) { + type A struct { + Foo string `json:"foo"` + } + type B struct { + Foo string `json:"foo"` + } + + payload := `{"foo": "test"}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, A{}, result.Type) // first wins on tie +} + +func TestPickBestUnionCandidate_OptionalPointerFields(t *testing.T) { + type A struct { + Foo *string `json:"foo"` + } + type B struct { + Foo *string `json:"foo"` + Bar *string `json:"bar"` + } + + payload := `{"foo": "test", "bar": "value"}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_OptionalPointerStructs(t *testing.T) { + type InnerA struct { + Name string `json:"name"` + } + type InnerB struct { + Name string `json:"name"` + Value string `json:"value"` + } + type A struct { + Nested *InnerA `json:"nested"` + } + type B struct { + Nested *InnerB `json:"nested"` + } + + payload := `{"nested": {"name": "test", "value": "data"}}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_NullPointerField(t *testing.T) { + type A struct { + Bar *string `json:"bar"` + } + type B struct { + Foo *string `json:"foo"` + } + + payload := `{"foo": null}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_NullNestedPointerField(t *testing.T) { + type InnerA struct { + Bar *string `json:"bar"` + } + type InnerB struct { + Bar *bool `json:"bar"` + } + type A struct { + Foo InnerA `json:"foo"` + } + type B struct { + Foo InnerB `json:"foo"` + } + + payload := `{"foo": {"bar": null}}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, A{}, result.Type) // first wins on tie +} + +func TestPickBestUnionCandidate_NullNonPointerField(t *testing.T) { + type A struct { + Foo string `json:"foo"` + } + type B struct { + Foo string `json:"foo"` + Bar string `json:"bar"` + } + + payload := `{"foo": "", "bar": null}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_NullNestedFieldDifferentStructs(t *testing.T) { + type InnerA struct { + Bar string `json:"bar"` + } + type InnerB struct { + Baz *string `json:"baz"` + } + type A struct { + Foo InnerA `json:"foo"` + } + type B struct { + Foo InnerB `json:"foo"` + } + + payload := `{"foo": {"baz": null}}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_NullNestedFieldBothPresent(t *testing.T) { + type InnerA struct { + Bar *string `json:"bar"` + } + type InnerB struct { + Baz *string `json:"baz"` + } + type A struct { + Foo InnerA `json:"foo"` + } + type B struct { + Foo InnerB `json:"foo"` + } + + payload := `{"foo": {"bar": null, "baz": null}}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, A{}, result.Type) // first wins on tie +} + +// EnumA represents an enum with values 1 or 2 +type EnumA int + +func (e *EnumA) IsExact() bool { + return *e == 1 || *e == 2 +} + +func (e *EnumA) UnmarshalJSON(data []byte) error { + var v int + if err := json.Unmarshal(data, &v); err != nil { + return err + } + *e = EnumA(v) + return nil +} + +// EnumB represents an enum with values 3 or 4 +type EnumB int + +func (e *EnumB) IsExact() bool { + return *e == 3 || *e == 4 +} + +func (e *EnumB) UnmarshalJSON(data []byte) error { + var v int + if err := json.Unmarshal(data, &v); err != nil { + return err + } + *e = EnumB(v) + return nil +} + +func TestPickBestUnionCandidate_EnumDiscrimination(t *testing.T) { + type A struct { + Val EnumA `json:"a"` + } + type B struct { + Val EnumB `json:"a"` + } + + payload := `{"a": 4}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_ThreeWayFieldDiscrimination(t *testing.T) { + type A struct { + FieldA string `json:"a"` + FieldB string `json:"b"` + } + type B struct { + FieldA string `json:"a"` + FieldC string `json:"c"` + } + type C struct { + FieldB string `json:"b"` + FieldC string `json:"c"` + } + + payload := `{"b": "", "c": ""}` + candidates := makeCandidates(t, payload, A{}, B{}, C{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, C{}, result.Type) +} + +func TestPickBestUnionCandidate_ConstFieldDiscrimination(t *testing.T) { + type A struct { + ConstA string `json:"a" const:"x"` + ConstB string `json:"b" const:"1"` + } + type B struct { + ConstA string `json:"a" const:"x"` + ConstC string `json:"c" const:"1"` + } + type C struct { + ConstB string `json:"b" const:"1"` + ConstC string `json:"c" const:"1"` + } + + payload := `{"b": "1", "c": "1"}` + candidates := makeCandidates(t, payload, A{}, B{}, C{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, C{}, result.Type) +} + +func TestPickBestUnionCandidate_NullPayload(t *testing.T) { + type A struct { + Foo string `json:"foo"` + } + type B *string // nullable type + + payload := `null` + + candidates := makeCandidates(t, payload, A{}, B(nil)) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + _, isB := result.Type.(B) + assert.True(t, isB, "expected B (nullable type) to win for null payload") +} + +func TestPickBestUnionCandidate_PrimitiveStringTypes(t *testing.T) { + // When both types are strings, first wins on tie + type A = string + type B = string + + payload := `"asdf"` + + candidates := makeCandidates(t, payload, A(""), B("")) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + _, isA := result.Type.(A) + assert.True(t, isA, "expected A (first type) to win on tie") +} + +func TestPickBestUnionCandidate_NullPointerPrimitives(t *testing.T) { + // A: *string, B: *float64 + // payload: null + // Both can be null, first wins + type A = *string + type B = *float64 + + payload := `null` + + candidates := makeCandidates(t, payload, A(nil), B(nil)) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + _, isA := result.Type.(A) + assert.True(t, isA, "expected A (*string) to win for null payload (first wins on tie)") +} + +func TestPickBestUnionCandidate_NullPointersMatchOverMissingFields(t *testing.T) { + // A: { a: string } + // B: { b: *string, c: *string } + // payload: { "b": null, "c": null } + // B wins because it has 2 matched fields, A has 0 + type A struct { + A string `json:"a"` + } + type B struct { + B *string `json:"b"` + C *string `json:"c"` + } + + payload := `{"b": null, "c": null}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_MapOfStructs(t *testing.T) { + // A: map[string]{ a: string } + // B: map[string]{ b: string } + // payload: { "x": null, "y": null, "z": { "b": "b" } } + // B wins because it has a matched field in the nested struct + type InnerA struct { + A string `json:"a"` + } + type InnerB struct { + B string `json:"b"` + } + type A = map[string]*InnerA + type B = map[string]*InnerB + + payload := `{"x": null, "y": null, "z": {"b": "b"}}` + + candidates := makeCandidates(t, payload, A(nil), B(nil)) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + _, isB := result.Type.(B) + assert.True(t, isB, "expected B (map with matching struct field) to win") +} + +func TestPickBestUnionCandidate_NullPointerStructVsString(t *testing.T) { + // A: *{foo: string}, B: *string + // payload: null + type Inner struct { + Foo string `json:"foo"` + } + type A = *Inner + type B = *string + + payload := `null` + + candidates := makeCandidates(t, payload, A(nil), B(nil)) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + _, isA := result.Type.(A) + assert.True(t, isA, "expected A (*struct) to win for null payload (first wins on tie)") +} + +func TestPickBestUnionCandidate_MapWithNestedStructsVsSimpleField(t *testing.T) { + // A: { a: string } + // B: { b: map[string]{ id: string, name: string } } + // payload: { "a": "", "b": { "foo": { "id": "", "name": "" } } } + // B should win because it has more matched fields (id, name in nested struct) + type Inner struct { + ID string `json:"id"` + Name string `json:"name"` + } + type A struct { + A string `json:"a"` + } + type B struct { + B map[string]Inner `json:"b"` + } + + payload := `{"a": "", "b": {"foo": {"id": "", "name": ""}}}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_AdditionalPropertiesWins(t *testing.T) { + type A struct { + A string `json:"a"` + } + type B struct { + B string `json:"b"` + AdditionalProperties map[string]string `additionalProperties:"true"` + } + + payload := `{"a": "", "b": "", "c": ""}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_StructVsMapOfStrings(t *testing.T) { + // A: map[string]string + // B: { id: string } + // payload: { "id": "", "foo": "" } + // B should win because struct fields are more specific than map + type A = map[string]string + type B struct { + ID string `json:"id"` + } + + payload := `{"id": "", "foo": ""}` + + candidates := makeCandidates(t, payload, A(nil), B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, A{}, result.Type) +} + +func TestPickBestUnionCandidate_AdditionalPropertiesVsExactField(t *testing.T) { + // A: { id: *string, additionalProperties: true } + // B: { foo: string } + // payload: { "foo": "" } + // B should win because it has an exact field match, while A only matches via additionalProperties + type A struct { + ID *string `json:"id"` + AdditionalProperties map[string]string `additionalProperties:"true"` + } + type B struct { + Foo string `json:"foo"` + } + + payload := `{"foo": ""}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_ArrayOfNullableStructs(t *testing.T) { + // A: Array<{ foo: *string } | null> + // B: Array<{ bar: *string } | null> + // payload: [null, null, { "bar": "" }] + // B should win because it has a matching field in the non-null element + type ItemA struct { + Foo *string `json:"foo"` + } + type ItemB struct { + Bar *string `json:"bar"` + } + type A = []*ItemA + type B = []*ItemB + + payload := `[null, null, {"bar": ""}]` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} + +func TestPickBestUnionCandidate_AnyFieldType(t *testing.T) { + // A: { a: string } + // B: { b: any } + // payload: { "b": "asdf" } + // B should win because it has a matching field + type A struct { + A string `json:"a"` + } + type B struct { + B any `json:"b"` + } + + payload := `{"b": "asdf"}` + candidates := makeCandidates(t, payload, A{}, B{}) + result := PickBestUnionCandidate(candidates, []byte(payload)) + + require.NotNil(t, result) + assert.IsType(t, B{}, result.Type) +} diff --git a/sdks/outpost-go/internal/utils/utils.go b/sdks/outpost-go/internal/utils/utils.go index ea624e75b..0415b5365 100644 --- a/sdks/outpost-go/internal/utils/utils.go +++ b/sdks/outpost-go/internal/utils/utils.go @@ -14,8 +14,6 @@ import ( "strconv" "strings" "time" - - "github.com/ericlagergren/decimal" ) const ( @@ -183,8 +181,6 @@ func valToString(val interface{}) string { return v.Format(time.RFC3339Nano) case big.Int: return v.String() - case decimal.Big: - return v.String() default: return fmt.Sprintf("%v", v) } @@ -245,6 +241,21 @@ func isNil(typ reflect.Type, val reflect.Value) bool { return false } +func isEmptyContainer(typ reflect.Type, val reflect.Value) bool { + if isNil(typ, val) { + return true + } + + switch typ.Kind() { + case reflect.Slice, reflect.Array: + return val.Len() == 0 + case reflect.Map: + return val.Len() == 0 + default: + return false + } +} + func contains(arr []string, str string) bool { for _, a := range arr { if a == str { diff --git a/sdks/outpost-go/models/apierrors/listtenants.go b/sdks/outpost-go/models/apierrors/listtenants.go new file mode 100644 index 000000000..50c25b1c4 --- /dev/null +++ b/sdks/outpost-go/models/apierrors/listtenants.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package apierrors + +import ( + "encoding/json" + "github.com/hookdeck/outpost/sdks/outpost-go/models/components" +) + +// NotImplementedError - List Tenants feature is not available. Requires Redis with RediSearch module. +type NotImplementedError struct { + Error_ *string `json:"error,omitempty"` + HTTPMeta components.HTTPMetadata `json:"-"` +} + +var _ error = &NotImplementedError{} + +func (e *NotImplementedError) Error() string { + data, _ := json.Marshal(e) + return string(data) +} + +// ListTenantsBadRequestError - Invalid request parameters (e.g., invalid cursor, both next and prev provided). +type ListTenantsBadRequestError struct { + Error_ *string `json:"error,omitempty"` + HTTPMeta components.HTTPMetadata `json:"-"` +} + +var _ error = &ListTenantsBadRequestError{} + +func (e *ListTenantsBadRequestError) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/sdks/outpost-go/models/components/awskinesisconfig.go b/sdks/outpost-go/models/components/awskinesisconfig.go index c2010ca07..59f714679 100644 --- a/sdks/outpost-go/models/components/awskinesisconfig.go +++ b/sdks/outpost-go/models/components/awskinesisconfig.go @@ -28,30 +28,30 @@ func (a *AWSKinesisConfig) UnmarshalJSON(data []byte) error { return nil } -func (o *AWSKinesisConfig) GetStreamName() string { - if o == nil { +func (a *AWSKinesisConfig) GetStreamName() string { + if a == nil { return "" } - return o.StreamName + return a.StreamName } -func (o *AWSKinesisConfig) GetRegion() string { - if o == nil { +func (a *AWSKinesisConfig) GetRegion() string { + if a == nil { return "" } - return o.Region + return a.Region } -func (o *AWSKinesisConfig) GetEndpoint() *string { - if o == nil { +func (a *AWSKinesisConfig) GetEndpoint() *string { + if a == nil { return nil } - return o.Endpoint + return a.Endpoint } -func (o *AWSKinesisConfig) GetPartitionKeyTemplate() *string { - if o == nil { +func (a *AWSKinesisConfig) GetPartitionKeyTemplate() *string { + if a == nil { return nil } - return o.PartitionKeyTemplate + return a.PartitionKeyTemplate } diff --git a/sdks/outpost-go/models/components/awskinesiscredentials.go b/sdks/outpost-go/models/components/awskinesiscredentials.go index 081bc9659..9b55f6eb0 100644 --- a/sdks/outpost-go/models/components/awskinesiscredentials.go +++ b/sdks/outpost-go/models/components/awskinesiscredentials.go @@ -26,23 +26,23 @@ func (a *AWSKinesisCredentials) UnmarshalJSON(data []byte) error { return nil } -func (o *AWSKinesisCredentials) GetKey() string { - if o == nil { +func (a *AWSKinesisCredentials) GetKey() string { + if a == nil { return "" } - return o.Key + return a.Key } -func (o *AWSKinesisCredentials) GetSecret() string { - if o == nil { +func (a *AWSKinesisCredentials) GetSecret() string { + if a == nil { return "" } - return o.Secret + return a.Secret } -func (o *AWSKinesisCredentials) GetSession() *string { - if o == nil { +func (a *AWSKinesisCredentials) GetSession() *string { + if a == nil { return nil } - return o.Session + return a.Session } diff --git a/sdks/outpost-go/models/components/awss3config.go b/sdks/outpost-go/models/components/awss3config.go index 38936eed9..74c486996 100644 --- a/sdks/outpost-go/models/components/awss3config.go +++ b/sdks/outpost-go/models/components/awss3config.go @@ -28,30 +28,30 @@ func (a *Awss3Config) UnmarshalJSON(data []byte) error { return nil } -func (o *Awss3Config) GetBucket() string { - if o == nil { +func (a *Awss3Config) GetBucket() string { + if a == nil { return "" } - return o.Bucket + return a.Bucket } -func (o *Awss3Config) GetRegion() string { - if o == nil { +func (a *Awss3Config) GetRegion() string { + if a == nil { return "" } - return o.Region + return a.Region } -func (o *Awss3Config) GetKeyTemplate() *string { - if o == nil { +func (a *Awss3Config) GetKeyTemplate() *string { + if a == nil { return nil } - return o.KeyTemplate + return a.KeyTemplate } -func (o *Awss3Config) GetStorageClass() *string { - if o == nil { +func (a *Awss3Config) GetStorageClass() *string { + if a == nil { return nil } - return o.StorageClass + return a.StorageClass } diff --git a/sdks/outpost-go/models/components/awss3credentials.go b/sdks/outpost-go/models/components/awss3credentials.go index f6fafe99f..cd6c8556c 100644 --- a/sdks/outpost-go/models/components/awss3credentials.go +++ b/sdks/outpost-go/models/components/awss3credentials.go @@ -26,23 +26,23 @@ func (a *Awss3Credentials) UnmarshalJSON(data []byte) error { return nil } -func (o *Awss3Credentials) GetKey() string { - if o == nil { +func (a *Awss3Credentials) GetKey() string { + if a == nil { return "" } - return o.Key + return a.Key } -func (o *Awss3Credentials) GetSecret() string { - if o == nil { +func (a *Awss3Credentials) GetSecret() string { + if a == nil { return "" } - return o.Secret + return a.Secret } -func (o *Awss3Credentials) GetSession() *string { - if o == nil { +func (a *Awss3Credentials) GetSession() *string { + if a == nil { return nil } - return o.Session + return a.Session } diff --git a/sdks/outpost-go/models/components/awssqsconfig.go b/sdks/outpost-go/models/components/awssqsconfig.go index 5367893c7..4e4c3e69c 100644 --- a/sdks/outpost-go/models/components/awssqsconfig.go +++ b/sdks/outpost-go/models/components/awssqsconfig.go @@ -24,16 +24,16 @@ func (a *AWSSQSConfig) UnmarshalJSON(data []byte) error { return nil } -func (o *AWSSQSConfig) GetEndpoint() *string { - if o == nil { +func (a *AWSSQSConfig) GetEndpoint() *string { + if a == nil { return nil } - return o.Endpoint + return a.Endpoint } -func (o *AWSSQSConfig) GetQueueURL() string { - if o == nil { +func (a *AWSSQSConfig) GetQueueURL() string { + if a == nil { return "" } - return o.QueueURL + return a.QueueURL } diff --git a/sdks/outpost-go/models/components/awssqscredentials.go b/sdks/outpost-go/models/components/awssqscredentials.go index 1099d2f0b..928726dd3 100644 --- a/sdks/outpost-go/models/components/awssqscredentials.go +++ b/sdks/outpost-go/models/components/awssqscredentials.go @@ -26,23 +26,23 @@ func (a *AWSSQSCredentials) UnmarshalJSON(data []byte) error { return nil } -func (o *AWSSQSCredentials) GetKey() string { - if o == nil { +func (a *AWSSQSCredentials) GetKey() string { + if a == nil { return "" } - return o.Key + return a.Key } -func (o *AWSSQSCredentials) GetSecret() string { - if o == nil { +func (a *AWSSQSCredentials) GetSecret() string { + if a == nil { return "" } - return o.Secret + return a.Secret } -func (o *AWSSQSCredentials) GetSession() *string { - if o == nil { +func (a *AWSSQSCredentials) GetSession() *string { + if a == nil { return nil } - return o.Session + return a.Session } diff --git a/sdks/outpost-go/models/components/azureservicebusconfig.go b/sdks/outpost-go/models/components/azureservicebusconfig.go index 8c271f500..59adc2eac 100644 --- a/sdks/outpost-go/models/components/azureservicebusconfig.go +++ b/sdks/outpost-go/models/components/azureservicebusconfig.go @@ -22,9 +22,9 @@ func (a *AzureServiceBusConfig) UnmarshalJSON(data []byte) error { return nil } -func (o *AzureServiceBusConfig) GetName() string { - if o == nil { +func (a *AzureServiceBusConfig) GetName() string { + if a == nil { return "" } - return o.Name + return a.Name } diff --git a/sdks/outpost-go/models/components/azureservicebuscredentials.go b/sdks/outpost-go/models/components/azureservicebuscredentials.go index add655466..1fbdfce89 100644 --- a/sdks/outpost-go/models/components/azureservicebuscredentials.go +++ b/sdks/outpost-go/models/components/azureservicebuscredentials.go @@ -22,9 +22,9 @@ func (a *AzureServiceBusCredentials) UnmarshalJSON(data []byte) error { return nil } -func (o *AzureServiceBusCredentials) GetConnectionString() string { - if o == nil { +func (a *AzureServiceBusCredentials) GetConnectionString() string { + if a == nil { return "" } - return o.ConnectionString + return a.ConnectionString } diff --git a/sdks/outpost-go/models/components/deliveryattempt.go b/sdks/outpost-go/models/components/deliveryattempt.go index ea0a7370a..c16d4782d 100644 --- a/sdks/outpost-go/models/components/deliveryattempt.go +++ b/sdks/outpost-go/models/components/deliveryattempt.go @@ -9,17 +9,17 @@ import ( "time" ) -type Status string +type DeliveryAttemptStatus string const ( - StatusSuccess Status = "success" - StatusFailed Status = "failed" + DeliveryAttemptStatusSuccess DeliveryAttemptStatus = "success" + DeliveryAttemptStatusFailed DeliveryAttemptStatus = "failed" ) -func (e Status) ToPointer() *Status { +func (e DeliveryAttemptStatus) ToPointer() *DeliveryAttemptStatus { return &e } -func (e *Status) UnmarshalJSON(data []byte) error { +func (e *DeliveryAttemptStatus) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -28,19 +28,19 @@ func (e *Status) UnmarshalJSON(data []byte) error { case "success": fallthrough case "failed": - *e = Status(v) + *e = DeliveryAttemptStatus(v) return nil default: - return fmt.Errorf("invalid value for Status: %v", v) + return fmt.Errorf("invalid value for DeliveryAttemptStatus: %v", v) } } type DeliveryAttempt struct { - DeliveredAt *time.Time `json:"delivered_at,omitempty"` - Status *Status `json:"status,omitempty"` - ResponseStatusCode *int64 `json:"response_status_code,omitempty"` - ResponseBody *string `json:"response_body,omitempty"` - ResponseHeaders map[string]string `json:"response_headers,omitempty"` + DeliveredAt *time.Time `json:"delivered_at,omitempty"` + Status *DeliveryAttemptStatus `json:"status,omitempty"` + ResponseStatusCode *int64 `json:"response_status_code,omitempty"` + ResponseBody *string `json:"response_body,omitempty"` + ResponseHeaders map[string]string `json:"response_headers,omitempty"` } func (d DeliveryAttempt) MarshalJSON() ([]byte, error) { @@ -54,37 +54,37 @@ func (d *DeliveryAttempt) UnmarshalJSON(data []byte) error { return nil } -func (o *DeliveryAttempt) GetDeliveredAt() *time.Time { - if o == nil { +func (d *DeliveryAttempt) GetDeliveredAt() *time.Time { + if d == nil { return nil } - return o.DeliveredAt + return d.DeliveredAt } -func (o *DeliveryAttempt) GetStatus() *Status { - if o == nil { +func (d *DeliveryAttempt) GetStatus() *DeliveryAttemptStatus { + if d == nil { return nil } - return o.Status + return d.Status } -func (o *DeliveryAttempt) GetResponseStatusCode() *int64 { - if o == nil { +func (d *DeliveryAttempt) GetResponseStatusCode() *int64 { + if d == nil { return nil } - return o.ResponseStatusCode + return d.ResponseStatusCode } -func (o *DeliveryAttempt) GetResponseBody() *string { - if o == nil { +func (d *DeliveryAttempt) GetResponseBody() *string { + if d == nil { return nil } - return o.ResponseBody + return d.ResponseBody } -func (o *DeliveryAttempt) GetResponseHeaders() map[string]string { - if o == nil { +func (d *DeliveryAttempt) GetResponseHeaders() map[string]string { + if d == nil { return nil } - return o.ResponseHeaders + return d.ResponseHeaders } diff --git a/sdks/outpost-go/models/components/destination.go b/sdks/outpost-go/models/components/destination.go index e6ff15727..da106f19b 100644 --- a/sdks/outpost-go/models/components/destination.go +++ b/sdks/outpost-go/models/components/destination.go @@ -9,32 +9,34 @@ import ( "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" ) -type DestinationType string +type DestinationUnionType string const ( - DestinationTypeWebhook DestinationType = "webhook" - DestinationTypeAwsSqs DestinationType = "aws_sqs" - DestinationTypeRabbitmq DestinationType = "rabbitmq" - DestinationTypeHookdeck DestinationType = "hookdeck" - DestinationTypeAwsKinesis DestinationType = "aws_kinesis" - DestinationTypeAzureServicebus DestinationType = "azure_servicebus" - DestinationTypeAwsS3 DestinationType = "aws_s3" + DestinationUnionTypeWebhook DestinationUnionType = "webhook" + DestinationUnionTypeAwsSqs DestinationUnionType = "aws_sqs" + DestinationUnionTypeRabbitmq DestinationUnionType = "rabbitmq" + DestinationUnionTypeHookdeck DestinationUnionType = "hookdeck" + DestinationUnionTypeAwsKinesis DestinationUnionType = "aws_kinesis" + DestinationUnionTypeAzureServicebus DestinationUnionType = "azure_servicebus" + DestinationUnionTypeAwsS3 DestinationUnionType = "aws_s3" + DestinationUnionTypeGcpPubsub DestinationUnionType = "gcp_pubsub" ) type Destination struct { - DestinationWebhook *DestinationWebhook `queryParam:"inline" name:"Destination"` - DestinationAWSSQS *DestinationAWSSQS `queryParam:"inline" name:"Destination"` - DestinationRabbitMQ *DestinationRabbitMQ `queryParam:"inline" name:"Destination"` - DestinationHookdeck *DestinationHookdeck `queryParam:"inline" name:"Destination"` - DestinationAWSKinesis *DestinationAWSKinesis `queryParam:"inline" name:"Destination"` - DestinationAzureServiceBus *DestinationAzureServiceBus `queryParam:"inline" name:"Destination"` - DestinationAwss3 *DestinationAwss3 `queryParam:"inline" name:"Destination"` - - Type DestinationType + DestinationWebhook *DestinationWebhook `queryParam:"inline" union:"member"` + DestinationAWSSQS *DestinationAWSSQS `queryParam:"inline" union:"member"` + DestinationRabbitMQ *DestinationRabbitMQ `queryParam:"inline" union:"member"` + DestinationHookdeck *DestinationHookdeck `queryParam:"inline" union:"member"` + DestinationAWSKinesis *DestinationAWSKinesis `queryParam:"inline" union:"member"` + DestinationAzureServiceBus *DestinationAzureServiceBus `queryParam:"inline" union:"member"` + DestinationAwss3 *DestinationAwss3 `queryParam:"inline" union:"member"` + DestinationGCPPubSub *DestinationGCPPubSub `queryParam:"inline" union:"member"` + + Type DestinationUnionType } func CreateDestinationWebhook(webhook DestinationWebhook) Destination { - typ := DestinationTypeWebhook + typ := DestinationUnionTypeWebhook typStr := DestinationWebhookType(typ) webhook.Type = typStr @@ -46,7 +48,7 @@ func CreateDestinationWebhook(webhook DestinationWebhook) Destination { } func CreateDestinationAwsSqs(awsSqs DestinationAWSSQS) Destination { - typ := DestinationTypeAwsSqs + typ := DestinationUnionTypeAwsSqs typStr := DestinationAWSSQSType(typ) awsSqs.Type = typStr @@ -58,7 +60,7 @@ func CreateDestinationAwsSqs(awsSqs DestinationAWSSQS) Destination { } func CreateDestinationRabbitmq(rabbitmq DestinationRabbitMQ) Destination { - typ := DestinationTypeRabbitmq + typ := DestinationUnionTypeRabbitmq typStr := DestinationRabbitMQType(typ) rabbitmq.Type = typStr @@ -70,7 +72,7 @@ func CreateDestinationRabbitmq(rabbitmq DestinationRabbitMQ) Destination { } func CreateDestinationHookdeck(hookdeck DestinationHookdeck) Destination { - typ := DestinationTypeHookdeck + typ := DestinationUnionTypeHookdeck typStr := DestinationHookdeckType(typ) hookdeck.Type = typStr @@ -82,7 +84,7 @@ func CreateDestinationHookdeck(hookdeck DestinationHookdeck) Destination { } func CreateDestinationAwsKinesis(awsKinesis DestinationAWSKinesis) Destination { - typ := DestinationTypeAwsKinesis + typ := DestinationUnionTypeAwsKinesis typStr := DestinationAWSKinesisType(typ) awsKinesis.Type = typStr @@ -94,7 +96,7 @@ func CreateDestinationAwsKinesis(awsKinesis DestinationAWSKinesis) Destination { } func CreateDestinationAzureServicebus(azureServicebus DestinationAzureServiceBus) Destination { - typ := DestinationTypeAzureServicebus + typ := DestinationUnionTypeAzureServicebus typStr := DestinationAzureServiceBusType(typ) azureServicebus.Type = typStr @@ -106,7 +108,7 @@ func CreateDestinationAzureServicebus(azureServicebus DestinationAzureServiceBus } func CreateDestinationAwsS3(awsS3 DestinationAwss3) Destination { - typ := DestinationTypeAwsS3 + typ := DestinationUnionTypeAwsS3 typStr := DestinationAwss3Type(typ) awsS3.Type = typStr @@ -117,6 +119,18 @@ func CreateDestinationAwsS3(awsS3 DestinationAwss3) Destination { } } +func CreateDestinationGcpPubsub(gcpPubsub DestinationGCPPubSub) Destination { + typ := DestinationUnionTypeGcpPubsub + + typStr := DestinationGCPPubSubType(typ) + gcpPubsub.Type = typStr + + return Destination{ + DestinationGCPPubSub: &gcpPubsub, + Type: typ, + } +} + func (u *Destination) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -136,7 +150,7 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationWebhook = destinationWebhook - u.Type = DestinationTypeWebhook + u.Type = DestinationUnionTypeWebhook return nil case "aws_sqs": destinationAWSSQS := new(DestinationAWSSQS) @@ -145,7 +159,7 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationAWSSQS = destinationAWSSQS - u.Type = DestinationTypeAwsSqs + u.Type = DestinationUnionTypeAwsSqs return nil case "rabbitmq": destinationRabbitMQ := new(DestinationRabbitMQ) @@ -154,7 +168,7 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationRabbitMQ = destinationRabbitMQ - u.Type = DestinationTypeRabbitmq + u.Type = DestinationUnionTypeRabbitmq return nil case "hookdeck": destinationHookdeck := new(DestinationHookdeck) @@ -163,7 +177,7 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationHookdeck = destinationHookdeck - u.Type = DestinationTypeHookdeck + u.Type = DestinationUnionTypeHookdeck return nil case "aws_kinesis": destinationAWSKinesis := new(DestinationAWSKinesis) @@ -172,7 +186,7 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationAWSKinesis = destinationAWSKinesis - u.Type = DestinationTypeAwsKinesis + u.Type = DestinationUnionTypeAwsKinesis return nil case "azure_servicebus": destinationAzureServiceBus := new(DestinationAzureServiceBus) @@ -181,7 +195,7 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationAzureServiceBus = destinationAzureServiceBus - u.Type = DestinationTypeAzureServicebus + u.Type = DestinationUnionTypeAzureServicebus return nil case "aws_s3": destinationAwss3 := new(DestinationAwss3) @@ -190,7 +204,16 @@ func (u *Destination) UnmarshalJSON(data []byte) error { } u.DestinationAwss3 = destinationAwss3 - u.Type = DestinationTypeAwsS3 + u.Type = DestinationUnionTypeAwsS3 + return nil + case "gcp_pubsub": + destinationGCPPubSub := new(DestinationGCPPubSub) + if err := utils.UnmarshalJSON(data, &destinationGCPPubSub, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == gcp_pubsub) type DestinationGCPPubSub within Destination: %w", string(data), err) + } + + u.DestinationGCPPubSub = destinationGCPPubSub + u.Type = DestinationUnionTypeGcpPubsub return nil } @@ -226,5 +249,9 @@ func (u Destination) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.DestinationAwss3, "", true) } + if u.DestinationGCPPubSub != nil { + return utils.MarshalJSON(u.DestinationGCPPubSub, "", true) + } + return nil, errors.New("could not marshal union type Destination: all fields are null") } diff --git a/sdks/outpost-go/models/components/destinationawskinesis.go b/sdks/outpost-go/models/components/destinationawskinesis.go index c8485aa94..ce2cd7303 100644 --- a/sdks/outpost-go/models/components/destinationawskinesis.go +++ b/sdks/outpost-go/models/components/destinationawskinesis.go @@ -40,12 +40,24 @@ type DestinationAWSKinesis struct { Type DestinationAWSKinesisType `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt time.Time `json:"updated_at"` Config AWSKinesisConfig `json:"config"` Credentials AWSKinesisCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (Kinesis stream name). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (AWS Console link to the stream). Read-only. @@ -57,71 +69,99 @@ func (d DestinationAWSKinesis) MarshalJSON() ([]byte, error) { } func (d *DestinationAWSKinesis) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "config", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "updated_at", "config", "credentials"}); err != nil { return err } return nil } -func (o *DestinationAWSKinesis) GetID() string { - if o == nil { +func (d *DestinationAWSKinesis) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationAWSKinesis) GetType() DestinationAWSKinesisType { - if o == nil { +func (d *DestinationAWSKinesis) GetType() DestinationAWSKinesisType { + if d == nil { return DestinationAWSKinesisType("") } - return o.Type + return d.Type } -func (o *DestinationAWSKinesis) GetTopics() Topics { - if o == nil { +func (d *DestinationAWSKinesis) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationAWSKinesis) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationAWSKinesis) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationAWSKinesis) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationAWSKinesis) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationAWSKinesis) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DestinationAWSKinesis) GetUpdatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.UpdatedAt } -func (o *DestinationAWSKinesis) GetConfig() AWSKinesisConfig { - if o == nil { +func (d *DestinationAWSKinesis) GetConfig() AWSKinesisConfig { + if d == nil { return AWSKinesisConfig{} } - return o.Config + return d.Config } -func (o *DestinationAWSKinesis) GetCredentials() AWSKinesisCredentials { - if o == nil { +func (d *DestinationAWSKinesis) GetCredentials() AWSKinesisCredentials { + if d == nil { return AWSKinesisCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationAWSKinesis) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationAWSKinesis) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationAWSKinesis) GetTarget() *string { - if o == nil { +func (d *DestinationAWSKinesis) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationAWSKinesis) GetTargetURL() *string { - if o == nil { +func (d *DestinationAWSKinesis) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/destinationawss3.go b/sdks/outpost-go/models/components/destinationawss3.go index 6ede09fe5..320ed1200 100644 --- a/sdks/outpost-go/models/components/destinationawss3.go +++ b/sdks/outpost-go/models/components/destinationawss3.go @@ -40,12 +40,24 @@ type DestinationAwss3 struct { Type DestinationAwss3Type `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt time.Time `json:"updated_at"` Config Awss3Config `json:"config"` Credentials Awss3Credentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (bucket and region). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (AWS Console link to the bucket). Read-only. @@ -57,71 +69,99 @@ func (d DestinationAwss3) MarshalJSON() ([]byte, error) { } func (d *DestinationAwss3) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "config", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "updated_at", "config", "credentials"}); err != nil { return err } return nil } -func (o *DestinationAwss3) GetID() string { - if o == nil { +func (d *DestinationAwss3) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationAwss3) GetType() DestinationAwss3Type { - if o == nil { +func (d *DestinationAwss3) GetType() DestinationAwss3Type { + if d == nil { return DestinationAwss3Type("") } - return o.Type + return d.Type } -func (o *DestinationAwss3) GetTopics() Topics { - if o == nil { +func (d *DestinationAwss3) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationAwss3) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationAwss3) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationAwss3) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationAwss3) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationAwss3) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DestinationAwss3) GetUpdatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.UpdatedAt } -func (o *DestinationAwss3) GetConfig() Awss3Config { - if o == nil { +func (d *DestinationAwss3) GetConfig() Awss3Config { + if d == nil { return Awss3Config{} } - return o.Config + return d.Config } -func (o *DestinationAwss3) GetCredentials() Awss3Credentials { - if o == nil { +func (d *DestinationAwss3) GetCredentials() Awss3Credentials { + if d == nil { return Awss3Credentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationAwss3) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationAwss3) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationAwss3) GetTarget() *string { - if o == nil { +func (d *DestinationAwss3) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationAwss3) GetTargetURL() *string { - if o == nil { +func (d *DestinationAwss3) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/destinationawssqs.go b/sdks/outpost-go/models/components/destinationawssqs.go index da8421b98..88b3884a9 100644 --- a/sdks/outpost-go/models/components/destinationawssqs.go +++ b/sdks/outpost-go/models/components/destinationawssqs.go @@ -40,12 +40,24 @@ type DestinationAWSSQS struct { Type DestinationAWSSQSType `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt time.Time `json:"updated_at"` Config AWSSQSConfig `json:"config"` Credentials AWSSQSCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (SQS queue name). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (AWS Console link to the queue). Read-only. @@ -57,71 +69,99 @@ func (d DestinationAWSSQS) MarshalJSON() ([]byte, error) { } func (d *DestinationAWSSQS) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "config", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "updated_at", "config", "credentials"}); err != nil { return err } return nil } -func (o *DestinationAWSSQS) GetID() string { - if o == nil { +func (d *DestinationAWSSQS) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationAWSSQS) GetType() DestinationAWSSQSType { - if o == nil { +func (d *DestinationAWSSQS) GetType() DestinationAWSSQSType { + if d == nil { return DestinationAWSSQSType("") } - return o.Type + return d.Type } -func (o *DestinationAWSSQS) GetTopics() Topics { - if o == nil { +func (d *DestinationAWSSQS) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationAWSSQS) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationAWSSQS) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationAWSSQS) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationAWSSQS) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationAWSSQS) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DestinationAWSSQS) GetUpdatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.UpdatedAt } -func (o *DestinationAWSSQS) GetConfig() AWSSQSConfig { - if o == nil { +func (d *DestinationAWSSQS) GetConfig() AWSSQSConfig { + if d == nil { return AWSSQSConfig{} } - return o.Config + return d.Config } -func (o *DestinationAWSSQS) GetCredentials() AWSSQSCredentials { - if o == nil { +func (d *DestinationAWSSQS) GetCredentials() AWSSQSCredentials { + if d == nil { return AWSSQSCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationAWSSQS) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationAWSSQS) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationAWSSQS) GetTarget() *string { - if o == nil { +func (d *DestinationAWSSQS) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationAWSSQS) GetTargetURL() *string { - if o == nil { +func (d *DestinationAWSSQS) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/destinationazureservicebus.go b/sdks/outpost-go/models/components/destinationazureservicebus.go index d99d7bb6d..9d8763993 100644 --- a/sdks/outpost-go/models/components/destinationazureservicebus.go +++ b/sdks/outpost-go/models/components/destinationazureservicebus.go @@ -40,12 +40,24 @@ type DestinationAzureServiceBus struct { Type DestinationAzureServiceBusType `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` Config AzureServiceBusConfig `json:"config"` Credentials AzureServiceBusCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (Azure Service Bus queue/topic name). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (Azure Portal link to the Service Bus). Read-only. @@ -57,71 +69,99 @@ func (d DestinationAzureServiceBus) MarshalJSON() ([]byte, error) { } func (d *DestinationAzureServiceBus) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "config", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "config", "credentials"}); err != nil { return err } return nil } -func (o *DestinationAzureServiceBus) GetID() string { - if o == nil { +func (d *DestinationAzureServiceBus) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationAzureServiceBus) GetType() DestinationAzureServiceBusType { - if o == nil { +func (d *DestinationAzureServiceBus) GetType() DestinationAzureServiceBusType { + if d == nil { return DestinationAzureServiceBusType("") } - return o.Type + return d.Type } -func (o *DestinationAzureServiceBus) GetTopics() Topics { - if o == nil { +func (d *DestinationAzureServiceBus) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationAzureServiceBus) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationAzureServiceBus) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationAzureServiceBus) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationAzureServiceBus) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationAzureServiceBus) GetCreatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.CreatedAt +} + +func (d *DestinationAzureServiceBus) GetUpdatedAt() *time.Time { + if d == nil { + return nil + } + return d.UpdatedAt } -func (o *DestinationAzureServiceBus) GetConfig() AzureServiceBusConfig { - if o == nil { +func (d *DestinationAzureServiceBus) GetConfig() AzureServiceBusConfig { + if d == nil { return AzureServiceBusConfig{} } - return o.Config + return d.Config } -func (o *DestinationAzureServiceBus) GetCredentials() AzureServiceBusCredentials { - if o == nil { +func (d *DestinationAzureServiceBus) GetCredentials() AzureServiceBusCredentials { + if d == nil { return AzureServiceBusCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationAzureServiceBus) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationAzureServiceBus) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationAzureServiceBus) GetTarget() *string { - if o == nil { +func (d *DestinationAzureServiceBus) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationAzureServiceBus) GetTargetURL() *string { - if o == nil { +func (d *DestinationAzureServiceBus) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/destinationcreate.go b/sdks/outpost-go/models/components/destinationcreate.go index 016691d96..166aaf859 100644 --- a/sdks/outpost-go/models/components/destinationcreate.go +++ b/sdks/outpost-go/models/components/destinationcreate.go @@ -19,16 +19,18 @@ const ( DestinationCreateTypeAwsKinesis DestinationCreateType = "aws_kinesis" DestinationCreateTypeAzureServicebus DestinationCreateType = "azure_servicebus" DestinationCreateTypeAwsS3 DestinationCreateType = "aws_s3" + DestinationCreateTypeGcpPubsub DestinationCreateType = "gcp_pubsub" ) type DestinationCreate struct { - DestinationCreateWebhook *DestinationCreateWebhook `queryParam:"inline" name:"DestinationCreate"` - DestinationCreateAWSSQS *DestinationCreateAWSSQS `queryParam:"inline" name:"DestinationCreate"` - DestinationCreateRabbitMQ *DestinationCreateRabbitMQ `queryParam:"inline" name:"DestinationCreate"` - DestinationCreateHookdeck *DestinationCreateHookdeck `queryParam:"inline" name:"DestinationCreate"` - DestinationCreateAWSKinesis *DestinationCreateAWSKinesis `queryParam:"inline" name:"DestinationCreate"` - DestinationCreateAzureServiceBus *DestinationCreateAzureServiceBus `queryParam:"inline" name:"DestinationCreate"` - DestinationCreateAwss3 *DestinationCreateAwss3 `queryParam:"inline" name:"DestinationCreate"` + DestinationCreateWebhook *DestinationCreateWebhook `queryParam:"inline" union:"member"` + DestinationCreateAWSSQS *DestinationCreateAWSSQS `queryParam:"inline" union:"member"` + DestinationCreateRabbitMQ *DestinationCreateRabbitMQ `queryParam:"inline" union:"member"` + DestinationCreateHookdeck *DestinationCreateHookdeck `queryParam:"inline" union:"member"` + DestinationCreateAWSKinesis *DestinationCreateAWSKinesis `queryParam:"inline" union:"member"` + DestinationCreateAzureServiceBus *DestinationCreateAzureServiceBus `queryParam:"inline" union:"member"` + DestinationCreateAwss3 *DestinationCreateAwss3 `queryParam:"inline" union:"member"` + DestinationCreateGCPPubSub *DestinationCreateGCPPubSub `queryParam:"inline" union:"member"` Type DestinationCreateType } @@ -117,6 +119,18 @@ func CreateDestinationCreateAwsS3(awsS3 DestinationCreateAwss3) DestinationCreat } } +func CreateDestinationCreateGcpPubsub(gcpPubsub DestinationCreateGCPPubSub) DestinationCreate { + typ := DestinationCreateTypeGcpPubsub + + typStr := DestinationCreateGCPPubSubType(typ) + gcpPubsub.Type = typStr + + return DestinationCreate{ + DestinationCreateGCPPubSub: &gcpPubsub, + Type: typ, + } +} + func (u *DestinationCreate) UnmarshalJSON(data []byte) error { type discriminator struct { @@ -192,6 +206,15 @@ func (u *DestinationCreate) UnmarshalJSON(data []byte) error { u.DestinationCreateAwss3 = destinationCreateAwss3 u.Type = DestinationCreateTypeAwsS3 return nil + case "gcp_pubsub": + destinationCreateGCPPubSub := new(DestinationCreateGCPPubSub) + if err := utils.UnmarshalJSON(data, &destinationCreateGCPPubSub, "", true, nil); err != nil { + return fmt.Errorf("could not unmarshal `%s` into expected (Type == gcp_pubsub) type DestinationCreateGCPPubSub within DestinationCreate: %w", string(data), err) + } + + u.DestinationCreateGCPPubSub = destinationCreateGCPPubSub + u.Type = DestinationCreateTypeGcpPubsub + return nil } return fmt.Errorf("could not unmarshal `%s` into any supported union types for DestinationCreate", string(data)) @@ -226,5 +249,9 @@ func (u DestinationCreate) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.DestinationCreateAwss3, "", true) } + if u.DestinationCreateGCPPubSub != nil { + return utils.MarshalJSON(u.DestinationCreateGCPPubSub, "", true) + } + return nil, errors.New("could not marshal union type DestinationCreate: all fields are null") } diff --git a/sdks/outpost-go/models/components/destinationcreateawskinesis.go b/sdks/outpost-go/models/components/destinationcreateawskinesis.go index 838c588ed..c7b663bff 100644 --- a/sdks/outpost-go/models/components/destinationcreateawskinesis.go +++ b/sdks/outpost-go/models/components/destinationcreateawskinesis.go @@ -38,9 +38,19 @@ type DestinationCreateAWSKinesis struct { // Type of the destination. Must be 'aws_kinesis'. Type DestinationCreateAWSKinesisType `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config AWSKinesisConfig `json:"config"` Credentials AWSKinesisCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateAWSKinesis) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateAWSKinesis) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateAWSKinesis) GetID() *string { - if o == nil { +func (d *DestinationCreateAWSKinesis) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateAWSKinesis) GetType() DestinationCreateAWSKinesisType { - if o == nil { +func (d *DestinationCreateAWSKinesis) GetType() DestinationCreateAWSKinesisType { + if d == nil { return DestinationCreateAWSKinesisType("") } - return o.Type + return d.Type } -func (o *DestinationCreateAWSKinesis) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateAWSKinesis) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateAWSKinesis) GetConfig() AWSKinesisConfig { - if o == nil { +func (d *DestinationCreateAWSKinesis) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateAWSKinesis) GetConfig() AWSKinesisConfig { + if d == nil { return AWSKinesisConfig{} } - return o.Config + return d.Config } -func (o *DestinationCreateAWSKinesis) GetCredentials() AWSKinesisCredentials { - if o == nil { +func (d *DestinationCreateAWSKinesis) GetCredentials() AWSKinesisCredentials { + if d == nil { return AWSKinesisCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationCreateAWSKinesis) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateAWSKinesis) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationcreateawss3.go b/sdks/outpost-go/models/components/destinationcreateawss3.go index 88f3470b1..e8a39dc39 100644 --- a/sdks/outpost-go/models/components/destinationcreateawss3.go +++ b/sdks/outpost-go/models/components/destinationcreateawss3.go @@ -38,9 +38,19 @@ type DestinationCreateAwss3 struct { // Type of the destination. Must be 'aws_s3'. Type DestinationCreateAwss3Type `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config Awss3Config `json:"config"` Credentials Awss3Credentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateAwss3) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateAwss3) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateAwss3) GetID() *string { - if o == nil { +func (d *DestinationCreateAwss3) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateAwss3) GetType() DestinationCreateAwss3Type { - if o == nil { +func (d *DestinationCreateAwss3) GetType() DestinationCreateAwss3Type { + if d == nil { return DestinationCreateAwss3Type("") } - return o.Type + return d.Type } -func (o *DestinationCreateAwss3) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateAwss3) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateAwss3) GetConfig() Awss3Config { - if o == nil { +func (d *DestinationCreateAwss3) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateAwss3) GetConfig() Awss3Config { + if d == nil { return Awss3Config{} } - return o.Config + return d.Config } -func (o *DestinationCreateAwss3) GetCredentials() Awss3Credentials { - if o == nil { +func (d *DestinationCreateAwss3) GetCredentials() Awss3Credentials { + if d == nil { return Awss3Credentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationCreateAwss3) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateAwss3) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationcreateawssqs.go b/sdks/outpost-go/models/components/destinationcreateawssqs.go index 0e16c5a65..5710c3e0e 100644 --- a/sdks/outpost-go/models/components/destinationcreateawssqs.go +++ b/sdks/outpost-go/models/components/destinationcreateawssqs.go @@ -38,9 +38,19 @@ type DestinationCreateAWSSQS struct { // Type of the destination. Must be 'aws_sqs'. Type DestinationCreateAWSSQSType `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config AWSSQSConfig `json:"config"` Credentials AWSSQSCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateAWSSQS) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateAWSSQS) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateAWSSQS) GetID() *string { - if o == nil { +func (d *DestinationCreateAWSSQS) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateAWSSQS) GetType() DestinationCreateAWSSQSType { - if o == nil { +func (d *DestinationCreateAWSSQS) GetType() DestinationCreateAWSSQSType { + if d == nil { return DestinationCreateAWSSQSType("") } - return o.Type + return d.Type } -func (o *DestinationCreateAWSSQS) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateAWSSQS) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateAWSSQS) GetConfig() AWSSQSConfig { - if o == nil { +func (d *DestinationCreateAWSSQS) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateAWSSQS) GetConfig() AWSSQSConfig { + if d == nil { return AWSSQSConfig{} } - return o.Config + return d.Config } -func (o *DestinationCreateAWSSQS) GetCredentials() AWSSQSCredentials { - if o == nil { +func (d *DestinationCreateAWSSQS) GetCredentials() AWSSQSCredentials { + if d == nil { return AWSSQSCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationCreateAWSSQS) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateAWSSQS) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationcreateazureservicebus.go b/sdks/outpost-go/models/components/destinationcreateazureservicebus.go index 0e402a6ca..e7455ce20 100644 --- a/sdks/outpost-go/models/components/destinationcreateazureservicebus.go +++ b/sdks/outpost-go/models/components/destinationcreateazureservicebus.go @@ -38,9 +38,19 @@ type DestinationCreateAzureServiceBus struct { // Type of the destination. Must be 'azure_servicebus'. Type DestinationCreateAzureServiceBusType `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config AzureServiceBusConfig `json:"config"` Credentials AzureServiceBusCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateAzureServiceBus) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateAzureServiceBus) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateAzureServiceBus) GetID() *string { - if o == nil { +func (d *DestinationCreateAzureServiceBus) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateAzureServiceBus) GetType() DestinationCreateAzureServiceBusType { - if o == nil { +func (d *DestinationCreateAzureServiceBus) GetType() DestinationCreateAzureServiceBusType { + if d == nil { return DestinationCreateAzureServiceBusType("") } - return o.Type + return d.Type } -func (o *DestinationCreateAzureServiceBus) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateAzureServiceBus) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateAzureServiceBus) GetConfig() AzureServiceBusConfig { - if o == nil { +func (d *DestinationCreateAzureServiceBus) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateAzureServiceBus) GetConfig() AzureServiceBusConfig { + if d == nil { return AzureServiceBusConfig{} } - return o.Config + return d.Config } -func (o *DestinationCreateAzureServiceBus) GetCredentials() AzureServiceBusCredentials { - if o == nil { +func (d *DestinationCreateAzureServiceBus) GetCredentials() AzureServiceBusCredentials { + if d == nil { return AzureServiceBusCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationCreateAzureServiceBus) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateAzureServiceBus) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationcreategcppubsub.go b/sdks/outpost-go/models/components/destinationcreategcppubsub.go new file mode 100644 index 000000000..62500abac --- /dev/null +++ b/sdks/outpost-go/models/components/destinationcreategcppubsub.go @@ -0,0 +1,121 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" +) + +// DestinationCreateGCPPubSubType - Type of the destination. Must be 'gcp_pubsub'. +type DestinationCreateGCPPubSubType string + +const ( + DestinationCreateGCPPubSubTypeGcpPubsub DestinationCreateGCPPubSubType = "gcp_pubsub" +) + +func (e DestinationCreateGCPPubSubType) ToPointer() *DestinationCreateGCPPubSubType { + return &e +} +func (e *DestinationCreateGCPPubSubType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "gcp_pubsub": + *e = DestinationCreateGCPPubSubType(v) + return nil + default: + return fmt.Errorf("invalid value for DestinationCreateGCPPubSubType: %v", v) + } +} + +type DestinationCreateGCPPubSub struct { + // Optional user-provided ID. A UUID will be generated if empty. + ID *string `json:"id,omitempty"` + // Type of the destination. Must be 'gcp_pubsub'. + Type DestinationCreateGCPPubSubType `json:"type"` + // "*" or an array of enabled topics. + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` + Config GCPPubSubConfig `json:"config"` + Credentials GCPPubSubCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` +} + +func (d DestinationCreateGCPPubSub) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DestinationCreateGCPPubSub) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"type", "topics", "config", "credentials"}); err != nil { + return err + } + return nil +} + +func (d *DestinationCreateGCPPubSub) GetID() *string { + if d == nil { + return nil + } + return d.ID +} + +func (d *DestinationCreateGCPPubSub) GetType() DestinationCreateGCPPubSubType { + if d == nil { + return DestinationCreateGCPPubSubType("") + } + return d.Type +} + +func (d *DestinationCreateGCPPubSub) GetTopics() Topics { + if d == nil { + return Topics{} + } + return d.Topics +} + +func (d *DestinationCreateGCPPubSub) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateGCPPubSub) GetConfig() GCPPubSubConfig { + if d == nil { + return GCPPubSubConfig{} + } + return d.Config +} + +func (d *DestinationCreateGCPPubSub) GetCredentials() GCPPubSubCredentials { + if d == nil { + return GCPPubSubCredentials{} + } + return d.Credentials +} + +func (d *DestinationCreateGCPPubSub) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateGCPPubSub) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata +} diff --git a/sdks/outpost-go/models/components/destinationcreatehookdeck.go b/sdks/outpost-go/models/components/destinationcreatehookdeck.go index 4141ea2f7..8ad438713 100644 --- a/sdks/outpost-go/models/components/destinationcreatehookdeck.go +++ b/sdks/outpost-go/models/components/destinationcreatehookdeck.go @@ -38,9 +38,19 @@ type DestinationCreateHookdeck struct { // Type of the destination. Must be 'hookdeck'. Type DestinationCreateHookdeckType `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config any `json:"config,omitempty"` Credentials HookdeckCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateHookdeck) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateHookdeck) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateHookdeck) GetID() *string { - if o == nil { +func (d *DestinationCreateHookdeck) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateHookdeck) GetType() DestinationCreateHookdeckType { - if o == nil { +func (d *DestinationCreateHookdeck) GetType() DestinationCreateHookdeckType { + if d == nil { return DestinationCreateHookdeckType("") } - return o.Type + return d.Type } -func (o *DestinationCreateHookdeck) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateHookdeck) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateHookdeck) GetConfig() any { - if o == nil { +func (d *DestinationCreateHookdeck) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationCreateHookdeck) GetCredentials() HookdeckCredentials { - if o == nil { +func (d *DestinationCreateHookdeck) GetConfig() any { + if d == nil { + return nil + } + return d.Config +} + +func (d *DestinationCreateHookdeck) GetCredentials() HookdeckCredentials { + if d == nil { return HookdeckCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationCreateHookdeck) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateHookdeck) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationcreaterabbitmq.go b/sdks/outpost-go/models/components/destinationcreaterabbitmq.go index eb896e5db..ef892b4e8 100644 --- a/sdks/outpost-go/models/components/destinationcreaterabbitmq.go +++ b/sdks/outpost-go/models/components/destinationcreaterabbitmq.go @@ -38,9 +38,19 @@ type DestinationCreateRabbitMQ struct { // Type of the destination. Must be 'rabbitmq'. Type DestinationCreateRabbitMQType `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config RabbitMQConfig `json:"config"` Credentials RabbitMQCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateRabbitMQ) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateRabbitMQ) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateRabbitMQ) GetID() *string { - if o == nil { +func (d *DestinationCreateRabbitMQ) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateRabbitMQ) GetType() DestinationCreateRabbitMQType { - if o == nil { +func (d *DestinationCreateRabbitMQ) GetType() DestinationCreateRabbitMQType { + if d == nil { return DestinationCreateRabbitMQType("") } - return o.Type + return d.Type } -func (o *DestinationCreateRabbitMQ) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateRabbitMQ) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateRabbitMQ) GetConfig() RabbitMQConfig { - if o == nil { +func (d *DestinationCreateRabbitMQ) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateRabbitMQ) GetConfig() RabbitMQConfig { + if d == nil { return RabbitMQConfig{} } - return o.Config + return d.Config } -func (o *DestinationCreateRabbitMQ) GetCredentials() RabbitMQCredentials { - if o == nil { +func (d *DestinationCreateRabbitMQ) GetCredentials() RabbitMQCredentials { + if d == nil { return RabbitMQCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationCreateRabbitMQ) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationCreateRabbitMQ) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationcreatewebhook.go b/sdks/outpost-go/models/components/destinationcreatewebhook.go index 55d9cee13..7bc26668f 100644 --- a/sdks/outpost-go/models/components/destinationcreatewebhook.go +++ b/sdks/outpost-go/models/components/destinationcreatewebhook.go @@ -38,9 +38,19 @@ type DestinationCreateWebhook struct { // Type of the destination. Must be 'webhook'. Type DestinationCreateWebhookType `json:"type"` // "*" or an array of enabled topics. - Topics Topics `json:"topics"` + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config WebhookConfig `json:"config"` Credentials *WebhookCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationCreateWebhook) MarshalJSON() ([]byte, error) { @@ -54,37 +64,58 @@ func (d *DestinationCreateWebhook) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationCreateWebhook) GetID() *string { - if o == nil { +func (d *DestinationCreateWebhook) GetID() *string { + if d == nil { return nil } - return o.ID + return d.ID } -func (o *DestinationCreateWebhook) GetType() DestinationCreateWebhookType { - if o == nil { +func (d *DestinationCreateWebhook) GetType() DestinationCreateWebhookType { + if d == nil { return DestinationCreateWebhookType("") } - return o.Type + return d.Type } -func (o *DestinationCreateWebhook) GetTopics() Topics { - if o == nil { +func (d *DestinationCreateWebhook) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationCreateWebhook) GetConfig() WebhookConfig { - if o == nil { +func (d *DestinationCreateWebhook) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationCreateWebhook) GetConfig() WebhookConfig { + if d == nil { return WebhookConfig{} } - return o.Config + return d.Config +} + +func (d *DestinationCreateWebhook) GetCredentials() *WebhookCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationCreateWebhook) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata } -func (o *DestinationCreateWebhook) GetCredentials() *WebhookCredentials { - if o == nil { +func (d *DestinationCreateWebhook) GetMetadata() map[string]string { + if d == nil { return nil } - return o.Credentials + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationgcppubsub.go b/sdks/outpost-go/models/components/destinationgcppubsub.go new file mode 100644 index 000000000..f6c8b1349 --- /dev/null +++ b/sdks/outpost-go/models/components/destinationgcppubsub.go @@ -0,0 +1,167 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" + "time" +) + +// DestinationGCPPubSubType - Type of the destination. +type DestinationGCPPubSubType string + +const ( + DestinationGCPPubSubTypeGcpPubsub DestinationGCPPubSubType = "gcp_pubsub" +) + +func (e DestinationGCPPubSubType) ToPointer() *DestinationGCPPubSubType { + return &e +} +func (e *DestinationGCPPubSubType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "gcp_pubsub": + *e = DestinationGCPPubSubType(v) + return nil + default: + return fmt.Errorf("invalid value for DestinationGCPPubSubType: %v", v) + } +} + +type DestinationGCPPubSub struct { + // Control plane generated ID or user provided ID for the destination. + ID string `json:"id"` + // Type of the destination. + Type DestinationGCPPubSubType `json:"type"` + // "*" or an array of enabled topics. + Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` + // ISO Date when the destination was disabled, or null if enabled. + DisabledAt *time.Time `json:"disabled_at"` + // ISO Date when the destination was created. + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt time.Time `json:"updated_at"` + Config GCPPubSubConfig `json:"config"` + Credentials GCPPubSubCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` + // A human-readable representation of the destination target (project/topic). Read-only. + Target *string `json:"target,omitempty"` + // A URL link to the destination target (GCP Console link to the topic). Read-only. + TargetURL *string `json:"target_url,omitempty"` +} + +func (d DestinationGCPPubSub) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DestinationGCPPubSub) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "updated_at", "config", "credentials"}); err != nil { + return err + } + return nil +} + +func (d *DestinationGCPPubSub) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DestinationGCPPubSub) GetType() DestinationGCPPubSubType { + if d == nil { + return DestinationGCPPubSubType("") + } + return d.Type +} + +func (d *DestinationGCPPubSub) GetTopics() Topics { + if d == nil { + return Topics{} + } + return d.Topics +} + +func (d *DestinationGCPPubSub) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationGCPPubSub) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationGCPPubSub) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DestinationGCPPubSub) GetUpdatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.UpdatedAt +} + +func (d *DestinationGCPPubSub) GetConfig() GCPPubSubConfig { + if d == nil { + return GCPPubSubConfig{} + } + return d.Config +} + +func (d *DestinationGCPPubSub) GetCredentials() GCPPubSubCredentials { + if d == nil { + return GCPPubSubCredentials{} + } + return d.Credentials +} + +func (d *DestinationGCPPubSub) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationGCPPubSub) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata +} + +func (d *DestinationGCPPubSub) GetTarget() *string { + if d == nil { + return nil + } + return d.Target +} + +func (d *DestinationGCPPubSub) GetTargetURL() *string { + if d == nil { + return nil + } + return d.TargetURL +} diff --git a/sdks/outpost-go/models/components/destinationhookdeck.go b/sdks/outpost-go/models/components/destinationhookdeck.go index dbacc7fd0..a2f43ed36 100644 --- a/sdks/outpost-go/models/components/destinationhookdeck.go +++ b/sdks/outpost-go/models/components/destinationhookdeck.go @@ -40,12 +40,24 @@ type DestinationHookdeck struct { Type DestinationHookdeckType `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` Config any `json:"config,omitempty"` Credentials HookdeckCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (Hookdeck). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (e.g., Hookdeck dashboard). Read-only. @@ -57,71 +69,99 @@ func (d DestinationHookdeck) MarshalJSON() ([]byte, error) { } func (d *DestinationHookdeck) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "credentials"}); err != nil { return err } return nil } -func (o *DestinationHookdeck) GetID() string { - if o == nil { +func (d *DestinationHookdeck) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationHookdeck) GetType() DestinationHookdeckType { - if o == nil { +func (d *DestinationHookdeck) GetType() DestinationHookdeckType { + if d == nil { return DestinationHookdeckType("") } - return o.Type + return d.Type } -func (o *DestinationHookdeck) GetTopics() Topics { - if o == nil { +func (d *DestinationHookdeck) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationHookdeck) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationHookdeck) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationHookdeck) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationHookdeck) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationHookdeck) GetCreatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.CreatedAt +} + +func (d *DestinationHookdeck) GetUpdatedAt() *time.Time { + if d == nil { + return nil + } + return d.UpdatedAt } -func (o *DestinationHookdeck) GetConfig() any { - if o == nil { +func (d *DestinationHookdeck) GetConfig() any { + if d == nil { return nil } - return o.Config + return d.Config } -func (o *DestinationHookdeck) GetCredentials() HookdeckCredentials { - if o == nil { +func (d *DestinationHookdeck) GetCredentials() HookdeckCredentials { + if d == nil { return HookdeckCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationHookdeck) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationHookdeck) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationHookdeck) GetTarget() *string { - if o == nil { +func (d *DestinationHookdeck) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationHookdeck) GetTargetURL() *string { - if o == nil { +func (d *DestinationHookdeck) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/destinationrabbitmq.go b/sdks/outpost-go/models/components/destinationrabbitmq.go index cf0b2b4c8..07c9ec699 100644 --- a/sdks/outpost-go/models/components/destinationrabbitmq.go +++ b/sdks/outpost-go/models/components/destinationrabbitmq.go @@ -40,12 +40,24 @@ type DestinationRabbitMQ struct { Type DestinationRabbitMQType `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt time.Time `json:"updated_at"` Config RabbitMQConfig `json:"config"` Credentials RabbitMQCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (RabbitMQ exchange). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (not applicable for RabbitMQ exchange). Read-only. @@ -57,71 +69,99 @@ func (d DestinationRabbitMQ) MarshalJSON() ([]byte, error) { } func (d *DestinationRabbitMQ) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "config", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "updated_at", "config", "credentials"}); err != nil { return err } return nil } -func (o *DestinationRabbitMQ) GetID() string { - if o == nil { +func (d *DestinationRabbitMQ) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationRabbitMQ) GetType() DestinationRabbitMQType { - if o == nil { +func (d *DestinationRabbitMQ) GetType() DestinationRabbitMQType { + if d == nil { return DestinationRabbitMQType("") } - return o.Type + return d.Type } -func (o *DestinationRabbitMQ) GetTopics() Topics { - if o == nil { +func (d *DestinationRabbitMQ) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationRabbitMQ) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationRabbitMQ) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationRabbitMQ) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationRabbitMQ) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationRabbitMQ) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DestinationRabbitMQ) GetUpdatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.UpdatedAt } -func (o *DestinationRabbitMQ) GetConfig() RabbitMQConfig { - if o == nil { +func (d *DestinationRabbitMQ) GetConfig() RabbitMQConfig { + if d == nil { return RabbitMQConfig{} } - return o.Config + return d.Config } -func (o *DestinationRabbitMQ) GetCredentials() RabbitMQCredentials { - if o == nil { +func (d *DestinationRabbitMQ) GetCredentials() RabbitMQCredentials { + if d == nil { return RabbitMQCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationRabbitMQ) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationRabbitMQ) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationRabbitMQ) GetTarget() *string { - if o == nil { +func (d *DestinationRabbitMQ) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationRabbitMQ) GetTargetURL() *string { - if o == nil { +func (d *DestinationRabbitMQ) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/destinationschemafield.go b/sdks/outpost-go/models/components/destinationschemafield.go index 00014c6e7..751f6fa6e 100644 --- a/sdks/outpost-go/models/components/destinationschemafield.go +++ b/sdks/outpost-go/models/components/destinationschemafield.go @@ -50,65 +50,65 @@ type DestinationSchemaField struct { Pattern *string `json:"pattern,omitempty"` } -func (o *DestinationSchemaField) GetType() DestinationSchemaFieldType { - if o == nil { +func (d *DestinationSchemaField) GetType() DestinationSchemaFieldType { + if d == nil { return DestinationSchemaFieldType("") } - return o.Type + return d.Type } -func (o *DestinationSchemaField) GetLabel() *string { - if o == nil { +func (d *DestinationSchemaField) GetLabel() *string { + if d == nil { return nil } - return o.Label + return d.Label } -func (o *DestinationSchemaField) GetDescription() *string { - if o == nil { +func (d *DestinationSchemaField) GetDescription() *string { + if d == nil { return nil } - return o.Description + return d.Description } -func (o *DestinationSchemaField) GetRequired() bool { - if o == nil { +func (d *DestinationSchemaField) GetRequired() bool { + if d == nil { return false } - return o.Required + return d.Required } -func (o *DestinationSchemaField) GetSensitive() *bool { - if o == nil { +func (d *DestinationSchemaField) GetSensitive() *bool { + if d == nil { return nil } - return o.Sensitive + return d.Sensitive } -func (o *DestinationSchemaField) GetDefault() *string { - if o == nil { +func (d *DestinationSchemaField) GetDefault() *string { + if d == nil { return nil } - return o.Default + return d.Default } -func (o *DestinationSchemaField) GetMinlength() *int64 { - if o == nil { +func (d *DestinationSchemaField) GetMinlength() *int64 { + if d == nil { return nil } - return o.Minlength + return d.Minlength } -func (o *DestinationSchemaField) GetMaxlength() *int64 { - if o == nil { +func (d *DestinationSchemaField) GetMaxlength() *int64 { + if d == nil { return nil } - return o.Maxlength + return d.Maxlength } -func (o *DestinationSchemaField) GetPattern() *string { - if o == nil { +func (d *DestinationSchemaField) GetPattern() *string { + if d == nil { return nil } - return o.Pattern + return d.Pattern } diff --git a/sdks/outpost-go/models/components/destinationtype.go b/sdks/outpost-go/models/components/destinationtype.go new file mode 100644 index 000000000..4c1cb7427 --- /dev/null +++ b/sdks/outpost-go/models/components/destinationtype.go @@ -0,0 +1,53 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// DestinationType - Type of destination. +type DestinationType string + +const ( + DestinationTypeWebhook DestinationType = "webhook" + DestinationTypeAwsSqs DestinationType = "aws_sqs" + DestinationTypeRabbitmq DestinationType = "rabbitmq" + DestinationTypeHookdeck DestinationType = "hookdeck" + DestinationTypeAwsKinesis DestinationType = "aws_kinesis" + DestinationTypeAzureServicebus DestinationType = "azure_servicebus" + DestinationTypeAwsS3 DestinationType = "aws_s3" + DestinationTypeGcpPubsub DestinationType = "gcp_pubsub" +) + +func (e DestinationType) ToPointer() *DestinationType { + return &e +} +func (e *DestinationType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "webhook": + fallthrough + case "aws_sqs": + fallthrough + case "rabbitmq": + fallthrough + case "hookdeck": + fallthrough + case "aws_kinesis": + fallthrough + case "azure_servicebus": + fallthrough + case "aws_s3": + fallthrough + case "gcp_pubsub": + *e = DestinationType(v) + return nil + default: + return fmt.Errorf("invalid value for DestinationType: %v", v) + } +} diff --git a/sdks/outpost-go/models/components/destinationtypeschema.go b/sdks/outpost-go/models/components/destinationtypeschema.go index 384952fc3..e192cc003 100644 --- a/sdks/outpost-go/models/components/destinationtypeschema.go +++ b/sdks/outpost-go/models/components/destinationtypeschema.go @@ -19,58 +19,58 @@ type DestinationTypeSchema struct { CredentialFields []DestinationSchemaField `json:"credential_fields,omitempty"` } -func (o *DestinationTypeSchema) GetType() *string { - if o == nil { +func (d *DestinationTypeSchema) GetType() *string { + if d == nil { return nil } - return o.Type + return d.Type } -func (o *DestinationTypeSchema) GetLabel() *string { - if o == nil { +func (d *DestinationTypeSchema) GetLabel() *string { + if d == nil { return nil } - return o.Label + return d.Label } -func (o *DestinationTypeSchema) GetDescription() *string { - if o == nil { +func (d *DestinationTypeSchema) GetDescription() *string { + if d == nil { return nil } - return o.Description + return d.Description } -func (o *DestinationTypeSchema) GetIcon() *string { - if o == nil { +func (d *DestinationTypeSchema) GetIcon() *string { + if d == nil { return nil } - return o.Icon + return d.Icon } -func (o *DestinationTypeSchema) GetInstructions() *string { - if o == nil { +func (d *DestinationTypeSchema) GetInstructions() *string { + if d == nil { return nil } - return o.Instructions + return d.Instructions } -func (o *DestinationTypeSchema) GetRemoteSetupURL() *string { - if o == nil { +func (d *DestinationTypeSchema) GetRemoteSetupURL() *string { + if d == nil { return nil } - return o.RemoteSetupURL + return d.RemoteSetupURL } -func (o *DestinationTypeSchema) GetConfigFields() []DestinationSchemaField { - if o == nil { +func (d *DestinationTypeSchema) GetConfigFields() []DestinationSchemaField { + if d == nil { return nil } - return o.ConfigFields + return d.ConfigFields } -func (o *DestinationTypeSchema) GetCredentialFields() []DestinationSchemaField { - if o == nil { +func (d *DestinationTypeSchema) GetCredentialFields() []DestinationSchemaField { + if d == nil { return nil } - return o.CredentialFields + return d.CredentialFields } diff --git a/sdks/outpost-go/models/components/destinationupdate.go b/sdks/outpost-go/models/components/destinationupdate.go index 3c999239d..7ee37d76a 100644 --- a/sdks/outpost-go/models/components/destinationupdate.go +++ b/sdks/outpost-go/models/components/destinationupdate.go @@ -11,21 +11,25 @@ import ( type DestinationUpdateType string const ( - DestinationUpdateTypeDestinationUpdateWebhook DestinationUpdateType = "DestinationUpdateWebhook" - DestinationUpdateTypeDestinationUpdateAWSSQS DestinationUpdateType = "DestinationUpdateAWSSQS" - DestinationUpdateTypeDestinationUpdateRabbitMQ DestinationUpdateType = "DestinationUpdateRabbitMQ" - DestinationUpdateTypeDestinationUpdateHookdeck DestinationUpdateType = "DestinationUpdateHookdeck" - DestinationUpdateTypeDestinationUpdateAWSKinesis DestinationUpdateType = "DestinationUpdateAWSKinesis" - DestinationUpdateTypeDestinationUpdateAwss3 DestinationUpdateType = "DestinationUpdateAWSS3" + DestinationUpdateTypeDestinationUpdateWebhook DestinationUpdateType = "DestinationUpdateWebhook" + DestinationUpdateTypeDestinationUpdateAWSSQS DestinationUpdateType = "DestinationUpdateAWSSQS" + DestinationUpdateTypeDestinationUpdateRabbitMQ DestinationUpdateType = "DestinationUpdateRabbitMQ" + DestinationUpdateTypeDestinationUpdateHookdeck DestinationUpdateType = "DestinationUpdateHookdeck" + DestinationUpdateTypeDestinationUpdateAWSKinesis DestinationUpdateType = "DestinationUpdateAWSKinesis" + DestinationUpdateTypeDestinationUpdateAzureServiceBus DestinationUpdateType = "DestinationUpdateAzureServiceBus" + DestinationUpdateTypeDestinationUpdateAwss3 DestinationUpdateType = "DestinationUpdateAWSS3" + DestinationUpdateTypeDestinationUpdateGCPPubSub DestinationUpdateType = "DestinationUpdateGCPPubSub" ) type DestinationUpdate struct { - DestinationUpdateWebhook *DestinationUpdateWebhook `queryParam:"inline" name:"DestinationUpdate"` - DestinationUpdateAWSSQS *DestinationUpdateAWSSQS `queryParam:"inline" name:"DestinationUpdate"` - DestinationUpdateRabbitMQ *DestinationUpdateRabbitMQ `queryParam:"inline" name:"DestinationUpdate"` - DestinationUpdateHookdeck *DestinationUpdateHookdeck `queryParam:"inline" name:"DestinationUpdate"` - DestinationUpdateAWSKinesis *DestinationUpdateAWSKinesis `queryParam:"inline" name:"DestinationUpdate"` - DestinationUpdateAwss3 *DestinationUpdateAwss3 `queryParam:"inline" name:"DestinationUpdate"` + DestinationUpdateWebhook *DestinationUpdateWebhook `queryParam:"inline" union:"member"` + DestinationUpdateAWSSQS *DestinationUpdateAWSSQS `queryParam:"inline" union:"member"` + DestinationUpdateRabbitMQ *DestinationUpdateRabbitMQ `queryParam:"inline" union:"member"` + DestinationUpdateHookdeck *DestinationUpdateHookdeck `queryParam:"inline" union:"member"` + DestinationUpdateAWSKinesis *DestinationUpdateAWSKinesis `queryParam:"inline" union:"member"` + DestinationUpdateAzureServiceBus *DestinationUpdateAzureServiceBus `queryParam:"inline" union:"member"` + DestinationUpdateAwss3 *DestinationUpdateAwss3 `queryParam:"inline" union:"member"` + DestinationUpdateGCPPubSub *DestinationUpdateGCPPubSub `queryParam:"inline" union:"member"` Type DestinationUpdateType } @@ -75,6 +79,15 @@ func CreateDestinationUpdateDestinationUpdateAWSKinesis(destinationUpdateAWSKine } } +func CreateDestinationUpdateDestinationUpdateAzureServiceBus(destinationUpdateAzureServiceBus DestinationUpdateAzureServiceBus) DestinationUpdate { + typ := DestinationUpdateTypeDestinationUpdateAzureServiceBus + + return DestinationUpdate{ + DestinationUpdateAzureServiceBus: &destinationUpdateAzureServiceBus, + Type: typ, + } +} + func CreateDestinationUpdateDestinationUpdateAwss3(destinationUpdateAwss3 DestinationUpdateAwss3) DestinationUpdate { typ := DestinationUpdateTypeDestinationUpdateAwss3 @@ -84,6 +97,15 @@ func CreateDestinationUpdateDestinationUpdateAwss3(destinationUpdateAwss3 Destin } } +func CreateDestinationUpdateDestinationUpdateGCPPubSub(destinationUpdateGCPPubSub DestinationUpdateGCPPubSub) DestinationUpdate { + typ := DestinationUpdateTypeDestinationUpdateGCPPubSub + + return DestinationUpdate{ + DestinationUpdateGCPPubSub: &destinationUpdateGCPPubSub, + Type: typ, + } +} + func (u *DestinationUpdate) UnmarshalJSON(data []byte) error { var destinationUpdateWebhook DestinationUpdateWebhook = DestinationUpdateWebhook{} @@ -121,6 +143,13 @@ func (u *DestinationUpdate) UnmarshalJSON(data []byte) error { return nil } + var destinationUpdateAzureServiceBus DestinationUpdateAzureServiceBus = DestinationUpdateAzureServiceBus{} + if err := utils.UnmarshalJSON(data, &destinationUpdateAzureServiceBus, "", true, nil); err == nil { + u.DestinationUpdateAzureServiceBus = &destinationUpdateAzureServiceBus + u.Type = DestinationUpdateTypeDestinationUpdateAzureServiceBus + return nil + } + var destinationUpdateAwss3 DestinationUpdateAwss3 = DestinationUpdateAwss3{} if err := utils.UnmarshalJSON(data, &destinationUpdateAwss3, "", true, nil); err == nil { u.DestinationUpdateAwss3 = &destinationUpdateAwss3 @@ -128,6 +157,13 @@ func (u *DestinationUpdate) UnmarshalJSON(data []byte) error { return nil } + var destinationUpdateGCPPubSub DestinationUpdateGCPPubSub = DestinationUpdateGCPPubSub{} + if err := utils.UnmarshalJSON(data, &destinationUpdateGCPPubSub, "", true, nil); err == nil { + u.DestinationUpdateGCPPubSub = &destinationUpdateGCPPubSub + u.Type = DestinationUpdateTypeDestinationUpdateGCPPubSub + return nil + } + return fmt.Errorf("could not unmarshal `%s` into any supported union types for DestinationUpdate", string(data)) } @@ -152,9 +188,17 @@ func (u DestinationUpdate) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.DestinationUpdateAWSKinesis, "", true) } + if u.DestinationUpdateAzureServiceBus != nil { + return utils.MarshalJSON(u.DestinationUpdateAzureServiceBus, "", true) + } + if u.DestinationUpdateAwss3 != nil { return utils.MarshalJSON(u.DestinationUpdateAwss3, "", true) } + if u.DestinationUpdateGCPPubSub != nil { + return utils.MarshalJSON(u.DestinationUpdateGCPPubSub, "", true) + } + return nil, errors.New("could not marshal union type DestinationUpdate: all fields are null") } diff --git a/sdks/outpost-go/models/components/destinationupdateawskinesis.go b/sdks/outpost-go/models/components/destinationupdateawskinesis.go index 83641f808..ba573a577 100644 --- a/sdks/outpost-go/models/components/destinationupdateawskinesis.go +++ b/sdks/outpost-go/models/components/destinationupdateawskinesis.go @@ -8,9 +8,19 @@ import ( type DestinationUpdateAWSKinesis struct { // "*" or an array of enabled topics. - Topics *Topics `json:"topics,omitempty"` + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config *AWSKinesisConfig `json:"config,omitempty"` Credentials *AWSKinesisCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationUpdateAWSKinesis) MarshalJSON() ([]byte, error) { @@ -24,23 +34,44 @@ func (d *DestinationUpdateAWSKinesis) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationUpdateAWSKinesis) GetTopics() *Topics { - if o == nil { +func (d *DestinationUpdateAWSKinesis) GetTopics() *Topics { + if d == nil { return nil } - return o.Topics + return d.Topics } -func (o *DestinationUpdateAWSKinesis) GetConfig() *AWSKinesisConfig { - if o == nil { +func (d *DestinationUpdateAWSKinesis) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationUpdateAWSKinesis) GetCredentials() *AWSKinesisCredentials { - if o == nil { +func (d *DestinationUpdateAWSKinesis) GetConfig() *AWSKinesisConfig { + if d == nil { return nil } - return o.Credentials + return d.Config +} + +func (d *DestinationUpdateAWSKinesis) GetCredentials() *AWSKinesisCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateAWSKinesis) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateAWSKinesis) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationupdateawss3.go b/sdks/outpost-go/models/components/destinationupdateawss3.go index 89e74e7f9..ddf43859d 100644 --- a/sdks/outpost-go/models/components/destinationupdateawss3.go +++ b/sdks/outpost-go/models/components/destinationupdateawss3.go @@ -8,9 +8,19 @@ import ( type DestinationUpdateAwss3 struct { // "*" or an array of enabled topics. - Topics *Topics `json:"topics,omitempty"` + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config *Awss3Config `json:"config,omitempty"` Credentials *Awss3Credentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationUpdateAwss3) MarshalJSON() ([]byte, error) { @@ -24,23 +34,44 @@ func (d *DestinationUpdateAwss3) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationUpdateAwss3) GetTopics() *Topics { - if o == nil { +func (d *DestinationUpdateAwss3) GetTopics() *Topics { + if d == nil { return nil } - return o.Topics + return d.Topics } -func (o *DestinationUpdateAwss3) GetConfig() *Awss3Config { - if o == nil { +func (d *DestinationUpdateAwss3) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationUpdateAwss3) GetCredentials() *Awss3Credentials { - if o == nil { +func (d *DestinationUpdateAwss3) GetConfig() *Awss3Config { + if d == nil { return nil } - return o.Credentials + return d.Config +} + +func (d *DestinationUpdateAwss3) GetCredentials() *Awss3Credentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateAwss3) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateAwss3) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationupdateawssqs.go b/sdks/outpost-go/models/components/destinationupdateawssqs.go index fbd7379c1..24d4f44d9 100644 --- a/sdks/outpost-go/models/components/destinationupdateawssqs.go +++ b/sdks/outpost-go/models/components/destinationupdateawssqs.go @@ -8,9 +8,19 @@ import ( type DestinationUpdateAWSSQS struct { // "*" or an array of enabled topics. - Topics *Topics `json:"topics,omitempty"` + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config *AWSSQSConfig `json:"config,omitempty"` Credentials *AWSSQSCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationUpdateAWSSQS) MarshalJSON() ([]byte, error) { @@ -24,23 +34,44 @@ func (d *DestinationUpdateAWSSQS) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationUpdateAWSSQS) GetTopics() *Topics { - if o == nil { +func (d *DestinationUpdateAWSSQS) GetTopics() *Topics { + if d == nil { return nil } - return o.Topics + return d.Topics } -func (o *DestinationUpdateAWSSQS) GetConfig() *AWSSQSConfig { - if o == nil { +func (d *DestinationUpdateAWSSQS) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationUpdateAWSSQS) GetCredentials() *AWSSQSCredentials { - if o == nil { +func (d *DestinationUpdateAWSSQS) GetConfig() *AWSSQSConfig { + if d == nil { return nil } - return o.Credentials + return d.Config +} + +func (d *DestinationUpdateAWSSQS) GetCredentials() *AWSSQSCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateAWSSQS) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateAWSSQS) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationupdateazureservicebus.go b/sdks/outpost-go/models/components/destinationupdateazureservicebus.go new file mode 100644 index 000000000..725c755dc --- /dev/null +++ b/sdks/outpost-go/models/components/destinationupdateazureservicebus.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" +) + +type DestinationUpdateAzureServiceBus struct { + // "*" or an array of enabled topics. + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` + Config *AzureServiceBusConfig `json:"config,omitempty"` + Credentials *AzureServiceBusCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` +} + +func (d DestinationUpdateAzureServiceBus) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DestinationUpdateAzureServiceBus) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DestinationUpdateAzureServiceBus) GetTopics() *Topics { + if d == nil { + return nil + } + return d.Topics +} + +func (d *DestinationUpdateAzureServiceBus) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationUpdateAzureServiceBus) GetConfig() *AzureServiceBusConfig { + if d == nil { + return nil + } + return d.Config +} + +func (d *DestinationUpdateAzureServiceBus) GetCredentials() *AzureServiceBusCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateAzureServiceBus) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateAzureServiceBus) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata +} diff --git a/sdks/outpost-go/models/components/destinationupdategcppubsub.go b/sdks/outpost-go/models/components/destinationupdategcppubsub.go new file mode 100644 index 000000000..3ebee0564 --- /dev/null +++ b/sdks/outpost-go/models/components/destinationupdategcppubsub.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" +) + +type DestinationUpdateGCPPubSub struct { + // "*" or an array of enabled topics. + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` + Config *GCPPubSubConfig `json:"config,omitempty"` + Credentials *GCPPubSubCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` +} + +func (d DestinationUpdateGCPPubSub) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(d, "", false) +} + +func (d *DestinationUpdateGCPPubSub) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &d, "", false, nil); err != nil { + return err + } + return nil +} + +func (d *DestinationUpdateGCPPubSub) GetTopics() *Topics { + if d == nil { + return nil + } + return d.Topics +} + +func (d *DestinationUpdateGCPPubSub) GetFilter() map[string]any { + if d == nil { + return nil + } + return d.Filter +} + +func (d *DestinationUpdateGCPPubSub) GetConfig() *GCPPubSubConfig { + if d == nil { + return nil + } + return d.Config +} + +func (d *DestinationUpdateGCPPubSub) GetCredentials() *GCPPubSubCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateGCPPubSub) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateGCPPubSub) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata +} diff --git a/sdks/outpost-go/models/components/destinationupdatehookdeck.go b/sdks/outpost-go/models/components/destinationupdatehookdeck.go index 8c73a5f34..9e0b867eb 100644 --- a/sdks/outpost-go/models/components/destinationupdatehookdeck.go +++ b/sdks/outpost-go/models/components/destinationupdatehookdeck.go @@ -8,9 +8,19 @@ import ( type DestinationUpdateHookdeck struct { // "*" or an array of enabled topics. - Topics *Topics `json:"topics,omitempty"` + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config any `json:"config,omitempty"` Credentials *HookdeckCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationUpdateHookdeck) MarshalJSON() ([]byte, error) { @@ -24,23 +34,44 @@ func (d *DestinationUpdateHookdeck) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationUpdateHookdeck) GetTopics() *Topics { - if o == nil { +func (d *DestinationUpdateHookdeck) GetTopics() *Topics { + if d == nil { return nil } - return o.Topics + return d.Topics } -func (o *DestinationUpdateHookdeck) GetConfig() any { - if o == nil { +func (d *DestinationUpdateHookdeck) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationUpdateHookdeck) GetCredentials() *HookdeckCredentials { - if o == nil { +func (d *DestinationUpdateHookdeck) GetConfig() any { + if d == nil { return nil } - return o.Credentials + return d.Config +} + +func (d *DestinationUpdateHookdeck) GetCredentials() *HookdeckCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateHookdeck) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateHookdeck) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationupdaterabbitmq.go b/sdks/outpost-go/models/components/destinationupdaterabbitmq.go index 3508e3eb9..69908540b 100644 --- a/sdks/outpost-go/models/components/destinationupdaterabbitmq.go +++ b/sdks/outpost-go/models/components/destinationupdaterabbitmq.go @@ -8,9 +8,19 @@ import ( type DestinationUpdateRabbitMQ struct { // "*" or an array of enabled topics. - Topics *Topics `json:"topics,omitempty"` + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config *RabbitMQConfig `json:"config,omitempty"` Credentials *RabbitMQCredentials `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationUpdateRabbitMQ) MarshalJSON() ([]byte, error) { @@ -24,23 +34,44 @@ func (d *DestinationUpdateRabbitMQ) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationUpdateRabbitMQ) GetTopics() *Topics { - if o == nil { +func (d *DestinationUpdateRabbitMQ) GetTopics() *Topics { + if d == nil { return nil } - return o.Topics + return d.Topics } -func (o *DestinationUpdateRabbitMQ) GetConfig() *RabbitMQConfig { - if o == nil { +func (d *DestinationUpdateRabbitMQ) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationUpdateRabbitMQ) GetCredentials() *RabbitMQCredentials { - if o == nil { +func (d *DestinationUpdateRabbitMQ) GetConfig() *RabbitMQConfig { + if d == nil { return nil } - return o.Credentials + return d.Config +} + +func (d *DestinationUpdateRabbitMQ) GetCredentials() *RabbitMQCredentials { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateRabbitMQ) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateRabbitMQ) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationupdatewebhook.go b/sdks/outpost-go/models/components/destinationupdatewebhook.go index 4e5d77baf..f09bfedb6 100644 --- a/sdks/outpost-go/models/components/destinationupdatewebhook.go +++ b/sdks/outpost-go/models/components/destinationupdatewebhook.go @@ -8,9 +8,19 @@ import ( type DestinationUpdateWebhook struct { // "*" or an array of enabled topics. - Topics *Topics `json:"topics,omitempty"` + Topics *Topics `json:"topics,omitempty"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` Config *WebhookConfig `json:"config,omitempty"` Credentials *WebhookCredentialsUpdate `json:"credentials,omitempty"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` } func (d DestinationUpdateWebhook) MarshalJSON() ([]byte, error) { @@ -24,23 +34,44 @@ func (d *DestinationUpdateWebhook) UnmarshalJSON(data []byte) error { return nil } -func (o *DestinationUpdateWebhook) GetTopics() *Topics { - if o == nil { +func (d *DestinationUpdateWebhook) GetTopics() *Topics { + if d == nil { return nil } - return o.Topics + return d.Topics } -func (o *DestinationUpdateWebhook) GetConfig() *WebhookConfig { - if o == nil { +func (d *DestinationUpdateWebhook) GetFilter() map[string]any { + if d == nil { return nil } - return o.Config + return d.Filter } -func (o *DestinationUpdateWebhook) GetCredentials() *WebhookCredentialsUpdate { - if o == nil { +func (d *DestinationUpdateWebhook) GetConfig() *WebhookConfig { + if d == nil { return nil } - return o.Credentials + return d.Config +} + +func (d *DestinationUpdateWebhook) GetCredentials() *WebhookCredentialsUpdate { + if d == nil { + return nil + } + return d.Credentials +} + +func (d *DestinationUpdateWebhook) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationUpdateWebhook) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } diff --git a/sdks/outpost-go/models/components/destinationwebhook.go b/sdks/outpost-go/models/components/destinationwebhook.go index 09870fcca..fe6d5f837 100644 --- a/sdks/outpost-go/models/components/destinationwebhook.go +++ b/sdks/outpost-go/models/components/destinationwebhook.go @@ -40,12 +40,24 @@ type DestinationWebhook struct { Type DestinationWebhookType `json:"type"` // "*" or an array of enabled topics. Topics Topics `json:"topics"` + // Optional JSON schema filter for event matching. Events must match this filter to be delivered to this destination. + // Supports operators: $eq, $neq, $gt, $gte, $lt, $lte, $in, $nin, $startsWith, $endsWith, $exist, $or, $and, $not. + // If null or empty, all events matching the topic filter will be delivered. + // To remove an existing filter when updating a destination, set filter to an empty object `{}`. + // + Filter map[string]any `json:"filter,omitempty"` // ISO Date when the destination was disabled, or null if enabled. DisabledAt *time.Time `json:"disabled_at"` // ISO Date when the destination was created. - CreatedAt time.Time `json:"created_at"` + CreatedAt time.Time `json:"created_at"` + // ISO Date when the destination was last updated. + UpdatedAt time.Time `json:"updated_at"` Config WebhookConfig `json:"config"` Credentials WebhookCredentials `json:"credentials"` + // Static key-value pairs merged into event metadata on every delivery. + DeliveryMetadata map[string]string `json:"delivery_metadata,omitempty"` + // Arbitrary contextual information stored with the destination. + Metadata map[string]string `json:"metadata,omitempty"` // A human-readable representation of the destination target (e.g., URL host). Read-only. Target *string `json:"target,omitempty"` // A URL link to the destination target (the webhook URL). Read-only. @@ -57,71 +69,99 @@ func (d DestinationWebhook) MarshalJSON() ([]byte, error) { } func (d *DestinationWebhook) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "disabled_at", "created_at", "config", "credentials"}); err != nil { + if err := utils.UnmarshalJSON(data, &d, "", false, []string{"id", "type", "topics", "created_at", "updated_at", "config", "credentials"}); err != nil { return err } return nil } -func (o *DestinationWebhook) GetID() string { - if o == nil { +func (d *DestinationWebhook) GetID() string { + if d == nil { return "" } - return o.ID + return d.ID } -func (o *DestinationWebhook) GetType() DestinationWebhookType { - if o == nil { +func (d *DestinationWebhook) GetType() DestinationWebhookType { + if d == nil { return DestinationWebhookType("") } - return o.Type + return d.Type } -func (o *DestinationWebhook) GetTopics() Topics { - if o == nil { +func (d *DestinationWebhook) GetTopics() Topics { + if d == nil { return Topics{} } - return o.Topics + return d.Topics } -func (o *DestinationWebhook) GetDisabledAt() *time.Time { - if o == nil { +func (d *DestinationWebhook) GetFilter() map[string]any { + if d == nil { return nil } - return o.DisabledAt + return d.Filter } -func (o *DestinationWebhook) GetCreatedAt() time.Time { - if o == nil { +func (d *DestinationWebhook) GetDisabledAt() *time.Time { + if d == nil { + return nil + } + return d.DisabledAt +} + +func (d *DestinationWebhook) GetCreatedAt() time.Time { + if d == nil { + return time.Time{} + } + return d.CreatedAt +} + +func (d *DestinationWebhook) GetUpdatedAt() time.Time { + if d == nil { return time.Time{} } - return o.CreatedAt + return d.UpdatedAt } -func (o *DestinationWebhook) GetConfig() WebhookConfig { - if o == nil { +func (d *DestinationWebhook) GetConfig() WebhookConfig { + if d == nil { return WebhookConfig{} } - return o.Config + return d.Config } -func (o *DestinationWebhook) GetCredentials() WebhookCredentials { - if o == nil { +func (d *DestinationWebhook) GetCredentials() WebhookCredentials { + if d == nil { return WebhookCredentials{} } - return o.Credentials + return d.Credentials +} + +func (d *DestinationWebhook) GetDeliveryMetadata() map[string]string { + if d == nil { + return nil + } + return d.DeliveryMetadata +} + +func (d *DestinationWebhook) GetMetadata() map[string]string { + if d == nil { + return nil + } + return d.Metadata } -func (o *DestinationWebhook) GetTarget() *string { - if o == nil { +func (d *DestinationWebhook) GetTarget() *string { + if d == nil { return nil } - return o.Target + return d.Target } -func (o *DestinationWebhook) GetTargetURL() *string { - if o == nil { +func (d *DestinationWebhook) GetTargetURL() *string { + if d == nil { return nil } - return o.TargetURL + return d.TargetURL } diff --git a/sdks/outpost-go/models/components/event.go b/sdks/outpost-go/models/components/event.go index d71badad4..072dd8f73 100644 --- a/sdks/outpost-go/models/components/event.go +++ b/sdks/outpost-go/models/components/event.go @@ -3,10 +3,38 @@ package components import ( + "encoding/json" + "fmt" "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" "time" ) +type EventStatus string + +const ( + EventStatusSuccess EventStatus = "success" + EventStatusFailed EventStatus = "failed" +) + +func (e EventStatus) ToPointer() *EventStatus { + return &e +} +func (e *EventStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "success": + fallthrough + case "failed": + *e = EventStatus(v) + return nil + default: + return fmt.Errorf("invalid value for EventStatus: %v", v) + } +} + type Event struct { ID *string `json:"id,omitempty"` DestinationID *string `json:"destination_id,omitempty"` @@ -17,6 +45,7 @@ type Event struct { SuccessfulAt *time.Time `json:"successful_at,omitempty"` // Key-value string pairs of metadata associated with the event. Metadata map[string]string `json:"metadata,omitempty"` + Status *EventStatus `json:"status,omitempty"` // Freeform JSON data of the event. Data map[string]any `json:"data,omitempty"` } @@ -32,51 +61,58 @@ func (e *Event) UnmarshalJSON(data []byte) error { return nil } -func (o *Event) GetID() *string { - if o == nil { +func (e *Event) GetID() *string { + if e == nil { + return nil + } + return e.ID +} + +func (e *Event) GetDestinationID() *string { + if e == nil { return nil } - return o.ID + return e.DestinationID } -func (o *Event) GetDestinationID() *string { - if o == nil { +func (e *Event) GetTopic() *string { + if e == nil { return nil } - return o.DestinationID + return e.Topic } -func (o *Event) GetTopic() *string { - if o == nil { +func (e *Event) GetTime() *time.Time { + if e == nil { return nil } - return o.Topic + return e.Time } -func (o *Event) GetTime() *time.Time { - if o == nil { +func (e *Event) GetSuccessfulAt() *time.Time { + if e == nil { return nil } - return o.Time + return e.SuccessfulAt } -func (o *Event) GetSuccessfulAt() *time.Time { - if o == nil { +func (e *Event) GetMetadata() map[string]string { + if e == nil { return nil } - return o.SuccessfulAt + return e.Metadata } -func (o *Event) GetMetadata() map[string]string { - if o == nil { +func (e *Event) GetStatus() *EventStatus { + if e == nil { return nil } - return o.Metadata + return e.Status } -func (o *Event) GetData() map[string]any { - if o == nil { +func (e *Event) GetData() map[string]any { + if e == nil { return nil } - return o.Data + return e.Data } diff --git a/sdks/outpost-go/models/components/gcppubsubconfig.go b/sdks/outpost-go/models/components/gcppubsubconfig.go new file mode 100644 index 000000000..9dd5995b6 --- /dev/null +++ b/sdks/outpost-go/models/components/gcppubsubconfig.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" +) + +type GCPPubSubConfig struct { + // The GCP project ID. + ProjectID string `json:"project_id"` + // The Pub/Sub topic name. + Topic string `json:"topic"` + // Optional. Custom endpoint URL (e.g., localhost:8085 for emulator). + Endpoint *string `json:"endpoint,omitempty"` +} + +func (g GCPPubSubConfig) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GCPPubSubConfig) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"project_id", "topic"}); err != nil { + return err + } + return nil +} + +func (g *GCPPubSubConfig) GetProjectID() string { + if g == nil { + return "" + } + return g.ProjectID +} + +func (g *GCPPubSubConfig) GetTopic() string { + if g == nil { + return "" + } + return g.Topic +} + +func (g *GCPPubSubConfig) GetEndpoint() *string { + if g == nil { + return nil + } + return g.Endpoint +} diff --git a/sdks/outpost-go/models/components/gcppubsubcredentials.go b/sdks/outpost-go/models/components/gcppubsubcredentials.go new file mode 100644 index 000000000..3e0cbe671 --- /dev/null +++ b/sdks/outpost-go/models/components/gcppubsubcredentials.go @@ -0,0 +1,30 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" +) + +type GCPPubSubCredentials struct { + // Service account key JSON. The entire JSON key file content as a string. + ServiceAccountJSON string `json:"service_account_json"` +} + +func (g GCPPubSubCredentials) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GCPPubSubCredentials) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, []string{"service_account_json"}); err != nil { + return err + } + return nil +} + +func (g *GCPPubSubCredentials) GetServiceAccountJSON() string { + if g == nil { + return "" + } + return g.ServiceAccountJSON +} diff --git a/sdks/outpost-go/models/components/hookdeckcredentials.go b/sdks/outpost-go/models/components/hookdeckcredentials.go index 5d33a3423..1fc05365c 100644 --- a/sdks/outpost-go/models/components/hookdeckcredentials.go +++ b/sdks/outpost-go/models/components/hookdeckcredentials.go @@ -22,9 +22,9 @@ func (h *HookdeckCredentials) UnmarshalJSON(data []byte) error { return nil } -func (o *HookdeckCredentials) GetToken() string { - if o == nil { +func (h *HookdeckCredentials) GetToken() string { + if h == nil { return "" } - return o.Token + return h.Token } diff --git a/sdks/outpost-go/models/components/httpmetadata.go b/sdks/outpost-go/models/components/httpmetadata.go index e18bdc060..148ec47fb 100644 --- a/sdks/outpost-go/models/components/httpmetadata.go +++ b/sdks/outpost-go/models/components/httpmetadata.go @@ -13,16 +13,16 @@ type HTTPMetadata struct { Request *http.Request `json:"-"` } -func (o *HTTPMetadata) GetResponse() *http.Response { - if o == nil { +func (h *HTTPMetadata) GetResponse() *http.Response { + if h == nil { return nil } - return o.Response + return h.Response } -func (o *HTTPMetadata) GetRequest() *http.Request { - if o == nil { +func (h *HTTPMetadata) GetRequest() *http.Request { + if h == nil { return nil } - return o.Request + return h.Request } diff --git a/sdks/outpost-go/models/components/portalredirect.go b/sdks/outpost-go/models/components/portalredirect.go index e9f867579..bcbeac221 100644 --- a/sdks/outpost-go/models/components/portalredirect.go +++ b/sdks/outpost-go/models/components/portalredirect.go @@ -5,11 +5,20 @@ package components type PortalRedirect struct { // Redirect URL containing a JWT to authenticate the user with the portal. RedirectURL *string `json:"redirect_url,omitempty"` + // The ID of the tenant associated with this portal session. + TenantID *string `json:"tenant_id,omitempty"` } -func (o *PortalRedirect) GetRedirectURL() *string { - if o == nil { +func (p *PortalRedirect) GetRedirectURL() *string { + if p == nil { return nil } - return o.RedirectURL + return p.RedirectURL +} + +func (p *PortalRedirect) GetTenantID() *string { + if p == nil { + return nil + } + return p.TenantID } diff --git a/sdks/outpost-go/models/components/publishrequest.go b/sdks/outpost-go/models/components/publishrequest.go index 64173878b..58a959b7d 100644 --- a/sdks/outpost-go/models/components/publishrequest.go +++ b/sdks/outpost-go/models/components/publishrequest.go @@ -19,51 +19,51 @@ type PublishRequest struct { Data map[string]any `json:"data"` } -func (o *PublishRequest) GetID() *string { - if o == nil { +func (p *PublishRequest) GetID() *string { + if p == nil { return nil } - return o.ID + return p.ID } -func (o *PublishRequest) GetTenantID() *string { - if o == nil { +func (p *PublishRequest) GetTenantID() *string { + if p == nil { return nil } - return o.TenantID + return p.TenantID } -func (o *PublishRequest) GetDestinationID() *string { - if o == nil { +func (p *PublishRequest) GetDestinationID() *string { + if p == nil { return nil } - return o.DestinationID + return p.DestinationID } -func (o *PublishRequest) GetTopic() *string { - if o == nil { +func (p *PublishRequest) GetTopic() *string { + if p == nil { return nil } - return o.Topic + return p.Topic } -func (o *PublishRequest) GetEligibleForRetry() *bool { - if o == nil { +func (p *PublishRequest) GetEligibleForRetry() *bool { + if p == nil { return nil } - return o.EligibleForRetry + return p.EligibleForRetry } -func (o *PublishRequest) GetMetadata() map[string]string { - if o == nil { +func (p *PublishRequest) GetMetadata() map[string]string { + if p == nil { return nil } - return o.Metadata + return p.Metadata } -func (o *PublishRequest) GetData() map[string]any { - if o == nil { +func (p *PublishRequest) GetData() map[string]any { + if p == nil { return map[string]any{} } - return o.Data + return p.Data } diff --git a/sdks/outpost-go/models/components/publishresponse.go b/sdks/outpost-go/models/components/publishresponse.go index 3ee453f6b..2aa6c7684 100644 --- a/sdks/outpost-go/models/components/publishresponse.go +++ b/sdks/outpost-go/models/components/publishresponse.go @@ -5,11 +5,20 @@ package components type PublishResponse struct { // The ID of the event that was accepted for publishing. This will be the ID provided in the request's `id` field if present, otherwise it's a server-generated UUID. ID string `json:"id"` + // Whether this event was already processed (idempotency hit). If true, the event was not queued again. + Duplicate bool `json:"duplicate"` } -func (o *PublishResponse) GetID() string { - if o == nil { +func (p *PublishResponse) GetID() string { + if p == nil { return "" } - return o.ID + return p.ID +} + +func (p *PublishResponse) GetDuplicate() bool { + if p == nil { + return false + } + return p.Duplicate } diff --git a/sdks/outpost-go/models/components/rabbitmqconfig.go b/sdks/outpost-go/models/components/rabbitmqconfig.go index 8aa648d06..2f1ba2f81 100644 --- a/sdks/outpost-go/models/components/rabbitmqconfig.go +++ b/sdks/outpost-go/models/components/rabbitmqconfig.go @@ -55,23 +55,23 @@ func (r *RabbitMQConfig) UnmarshalJSON(data []byte) error { return nil } -func (o *RabbitMQConfig) GetServerURL() string { - if o == nil { +func (r *RabbitMQConfig) GetServerURL() string { + if r == nil { return "" } - return o.ServerURL + return r.ServerURL } -func (o *RabbitMQConfig) GetExchange() string { - if o == nil { +func (r *RabbitMQConfig) GetExchange() string { + if r == nil { return "" } - return o.Exchange + return r.Exchange } -func (o *RabbitMQConfig) GetTLS() *TLS { - if o == nil { +func (r *RabbitMQConfig) GetTLS() *TLS { + if r == nil { return nil } - return o.TLS + return r.TLS } diff --git a/sdks/outpost-go/models/components/rabbitmqcredentials.go b/sdks/outpost-go/models/components/rabbitmqcredentials.go index 61714bcda..6065ea96a 100644 --- a/sdks/outpost-go/models/components/rabbitmqcredentials.go +++ b/sdks/outpost-go/models/components/rabbitmqcredentials.go @@ -24,16 +24,16 @@ func (r *RabbitMQCredentials) UnmarshalJSON(data []byte) error { return nil } -func (o *RabbitMQCredentials) GetUsername() string { - if o == nil { +func (r *RabbitMQCredentials) GetUsername() string { + if r == nil { return "" } - return o.Username + return r.Username } -func (o *RabbitMQCredentials) GetPassword() string { - if o == nil { +func (r *RabbitMQCredentials) GetPassword() string { + if r == nil { return "" } - return o.Password + return r.Password } diff --git a/sdks/outpost-go/models/components/security.go b/sdks/outpost-go/models/components/security.go index 7b9e6b188..83ae11f56 100644 --- a/sdks/outpost-go/models/components/security.go +++ b/sdks/outpost-go/models/components/security.go @@ -7,16 +7,16 @@ type Security struct { TenantJwt *string `security:"scheme,type=http,subtype=bearer,name=Authorization"` } -func (o *Security) GetAdminAPIKey() *string { - if o == nil { +func (s *Security) GetAdminAPIKey() *string { + if s == nil { return nil } - return o.AdminAPIKey + return s.AdminAPIKey } -func (o *Security) GetTenantJwt() *string { - if o == nil { +func (s *Security) GetTenantJwt() *string { + if s == nil { return nil } - return o.TenantJwt + return s.TenantJwt } diff --git a/sdks/outpost-go/models/components/successresponse.go b/sdks/outpost-go/models/components/successresponse.go index d7da9433a..cfd78c4e7 100644 --- a/sdks/outpost-go/models/components/successresponse.go +++ b/sdks/outpost-go/models/components/successresponse.go @@ -6,9 +6,9 @@ type SuccessResponse struct { Success *bool `json:"success,omitempty"` } -func (o *SuccessResponse) GetSuccess() *bool { - if o == nil { +func (s *SuccessResponse) GetSuccess() *bool { + if s == nil { return nil } - return o.Success + return s.Success } diff --git a/sdks/outpost-go/models/components/tenant.go b/sdks/outpost-go/models/components/tenant.go index 76d7b3a3e..87a469c84 100644 --- a/sdks/outpost-go/models/components/tenant.go +++ b/sdks/outpost-go/models/components/tenant.go @@ -14,8 +14,12 @@ type Tenant struct { DestinationsCount *int64 `json:"destinations_count,omitempty"` // List of subscribed topics across all destinations for this tenant. Topics []string `json:"topics,omitempty"` + // Arbitrary key-value pairs for storing contextual information about the tenant. + Metadata map[string]string `json:"metadata,omitempty"` // ISO Date when the tenant was created. CreatedAt *time.Time `json:"created_at,omitempty"` + // ISO Date when the tenant was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` } func (t Tenant) MarshalJSON() ([]byte, error) { @@ -29,30 +33,44 @@ func (t *Tenant) UnmarshalJSON(data []byte) error { return nil } -func (o *Tenant) GetID() *string { - if o == nil { +func (t *Tenant) GetID() *string { + if t == nil { return nil } - return o.ID + return t.ID } -func (o *Tenant) GetDestinationsCount() *int64 { - if o == nil { +func (t *Tenant) GetDestinationsCount() *int64 { + if t == nil { return nil } - return o.DestinationsCount + return t.DestinationsCount } -func (o *Tenant) GetTopics() []string { - if o == nil { +func (t *Tenant) GetTopics() []string { + if t == nil { return nil } - return o.Topics + return t.Topics } -func (o *Tenant) GetCreatedAt() *time.Time { - if o == nil { +func (t *Tenant) GetMetadata() map[string]string { + if t == nil { return nil } - return o.CreatedAt + return t.Metadata +} + +func (t *Tenant) GetCreatedAt() *time.Time { + if t == nil { + return nil + } + return t.CreatedAt +} + +func (t *Tenant) GetUpdatedAt() *time.Time { + if t == nil { + return nil + } + return t.UpdatedAt } diff --git a/sdks/outpost-go/models/components/tenantlistitem.go b/sdks/outpost-go/models/components/tenantlistitem.go new file mode 100644 index 000000000..709945e85 --- /dev/null +++ b/sdks/outpost-go/models/components/tenantlistitem.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" + "time" +) + +// TenantListItem - Tenant object returned in list operations. +type TenantListItem struct { + // User-defined system ID for the tenant. + ID *string `json:"id,omitempty"` + // Number of destinations associated with the tenant. + DestinationsCount *int64 `json:"destinations_count,omitempty"` + // List of subscribed topics across all destinations for this tenant. + Topics []string `json:"topics,omitempty"` + // Arbitrary key-value pairs for storing contextual information about the tenant. + Metadata map[string]string `json:"metadata,omitempty"` + // ISO Date when the tenant was created. + CreatedAt *time.Time `json:"created_at,omitempty"` + // ISO Date when the tenant was last updated. + UpdatedAt *time.Time `json:"updated_at,omitempty"` +} + +func (t TenantListItem) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TenantListItem) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &t, "", false, nil); err != nil { + return err + } + return nil +} + +func (t *TenantListItem) GetID() *string { + if t == nil { + return nil + } + return t.ID +} + +func (t *TenantListItem) GetDestinationsCount() *int64 { + if t == nil { + return nil + } + return t.DestinationsCount +} + +func (t *TenantListItem) GetTopics() []string { + if t == nil { + return nil + } + return t.Topics +} + +func (t *TenantListItem) GetMetadata() map[string]string { + if t == nil { + return nil + } + return t.Metadata +} + +func (t *TenantListItem) GetCreatedAt() *time.Time { + if t == nil { + return nil + } + return t.CreatedAt +} + +func (t *TenantListItem) GetUpdatedAt() *time.Time { + if t == nil { + return nil + } + return t.UpdatedAt +} diff --git a/sdks/outpost-go/models/components/tenantlistresponse.go b/sdks/outpost-go/models/components/tenantlistresponse.go new file mode 100644 index 000000000..7c9f969fa --- /dev/null +++ b/sdks/outpost-go/models/components/tenantlistresponse.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// TenantListResponse - Paginated list of tenants. +type TenantListResponse struct { + // Array of tenant objects. + Data []TenantListItem `json:"data,omitempty"` + // Cursor for the next page of results. Null if no more results. + Next *string `json:"next,omitempty"` + // Cursor for the previous page of results. Null if on first page. + Prev *string `json:"prev,omitempty"` + // Total count of all tenants. + Count *int64 `json:"count,omitempty"` +} + +func (t *TenantListResponse) GetData() []TenantListItem { + if t == nil { + return nil + } + return t.Data +} + +func (t *TenantListResponse) GetNext() *string { + if t == nil { + return nil + } + return t.Next +} + +func (t *TenantListResponse) GetPrev() *string { + if t == nil { + return nil + } + return t.Prev +} + +func (t *TenantListResponse) GetCount() *int64 { + if t == nil { + return nil + } + return t.Count +} diff --git a/sdks/outpost-go/models/components/tenanttoken.go b/sdks/outpost-go/models/components/tenanttoken.go index 053b47f71..3c4d2549e 100644 --- a/sdks/outpost-go/models/components/tenanttoken.go +++ b/sdks/outpost-go/models/components/tenanttoken.go @@ -5,11 +5,20 @@ package components type TenantToken struct { // JWT token scoped to the tenant for safe browser API calls. Token *string `json:"token,omitempty"` + // The ID of the tenant this token is scoped to. + TenantID *string `json:"tenant_id,omitempty"` } -func (o *TenantToken) GetToken() *string { - if o == nil { +func (t *TenantToken) GetToken() *string { + if t == nil { return nil } - return o.Token + return t.Token +} + +func (t *TenantToken) GetTenantID() *string { + if t == nil { + return nil + } + return t.TenantID } diff --git a/sdks/outpost-go/models/components/tenantupsert.go b/sdks/outpost-go/models/components/tenantupsert.go new file mode 100644 index 000000000..e0164b5ac --- /dev/null +++ b/sdks/outpost-go/models/components/tenantupsert.go @@ -0,0 +1,15 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type TenantUpsert struct { + // Optional metadata to store with the tenant. + Metadata map[string]string `json:"metadata,omitempty"` +} + +func (t *TenantUpsert) GetMetadata() map[string]string { + if t == nil { + return nil + } + return t.Metadata +} diff --git a/sdks/outpost-go/models/components/topics.go b/sdks/outpost-go/models/components/topics.go index f0693531c..3426767d1 100644 --- a/sdks/outpost-go/models/components/topics.go +++ b/sdks/outpost-go/models/components/topics.go @@ -41,8 +41,8 @@ const ( // Topics - "*" or an array of enabled topics. type Topics struct { - TopicsEnum *TopicsEnum `queryParam:"inline" name:"Topics"` - ArrayOfStr []string `queryParam:"inline" name:"Topics"` + TopicsEnum *TopicsEnum `queryParam:"inline" union:"member"` + ArrayOfStr []string `queryParam:"inline" union:"member"` Type TopicsType } diff --git a/sdks/outpost-go/models/components/webhookconfig.go b/sdks/outpost-go/models/components/webhookconfig.go index 15edef618..6b0b2ca94 100644 --- a/sdks/outpost-go/models/components/webhookconfig.go +++ b/sdks/outpost-go/models/components/webhookconfig.go @@ -9,6 +9,8 @@ import ( type WebhookConfig struct { // The URL to send the webhook events to. URL string `json:"url"` + // JSON string of custom HTTP headers to include with every webhook request. Header names must be valid HTTP header tokens (alphanumeric, hyphens, underscores). Reserved headers (Content-Type, Host, etc.) cannot be overridden. + CustomHeaders *string `json:"custom_headers,omitempty"` } func (w WebhookConfig) MarshalJSON() ([]byte, error) { @@ -22,9 +24,16 @@ func (w *WebhookConfig) UnmarshalJSON(data []byte) error { return nil } -func (o *WebhookConfig) GetURL() string { - if o == nil { +func (w *WebhookConfig) GetURL() string { + if w == nil { return "" } - return o.URL + return w.URL +} + +func (w *WebhookConfig) GetCustomHeaders() *string { + if w == nil { + return nil + } + return w.CustomHeaders } diff --git a/sdks/outpost-go/models/components/webhookcredentials.go b/sdks/outpost-go/models/components/webhookcredentials.go index 4b674b706..dd53e6779 100644 --- a/sdks/outpost-go/models/components/webhookcredentials.go +++ b/sdks/outpost-go/models/components/webhookcredentials.go @@ -27,23 +27,23 @@ func (w *WebhookCredentials) UnmarshalJSON(data []byte) error { return nil } -func (o *WebhookCredentials) GetSecret() *string { - if o == nil { +func (w *WebhookCredentials) GetSecret() *string { + if w == nil { return nil } - return o.Secret + return w.Secret } -func (o *WebhookCredentials) GetPreviousSecret() *string { - if o == nil { +func (w *WebhookCredentials) GetPreviousSecret() *string { + if w == nil { return nil } - return o.PreviousSecret + return w.PreviousSecret } -func (o *WebhookCredentials) GetPreviousSecretInvalidAt() *time.Time { - if o == nil { +func (w *WebhookCredentials) GetPreviousSecretInvalidAt() *time.Time { + if w == nil { return nil } - return o.PreviousSecretInvalidAt + return w.PreviousSecretInvalidAt } diff --git a/sdks/outpost-go/models/components/webhookcredentialsupdate.go b/sdks/outpost-go/models/components/webhookcredentialsupdate.go index cec9a255e..4cf95e637 100644 --- a/sdks/outpost-go/models/components/webhookcredentialsupdate.go +++ b/sdks/outpost-go/models/components/webhookcredentialsupdate.go @@ -29,30 +29,30 @@ func (w *WebhookCredentialsUpdate) UnmarshalJSON(data []byte) error { return nil } -func (o *WebhookCredentialsUpdate) GetSecret() *string { - if o == nil { +func (w *WebhookCredentialsUpdate) GetSecret() *string { + if w == nil { return nil } - return o.Secret + return w.Secret } -func (o *WebhookCredentialsUpdate) GetPreviousSecret() *string { - if o == nil { +func (w *WebhookCredentialsUpdate) GetPreviousSecret() *string { + if w == nil { return nil } - return o.PreviousSecret + return w.PreviousSecret } -func (o *WebhookCredentialsUpdate) GetPreviousSecretInvalidAt() *time.Time { - if o == nil { +func (w *WebhookCredentialsUpdate) GetPreviousSecretInvalidAt() *time.Time { + if w == nil { return nil } - return o.PreviousSecretInvalidAt + return w.PreviousSecretInvalidAt } -func (o *WebhookCredentialsUpdate) GetRotateSecret() *bool { - if o == nil { +func (w *WebhookCredentialsUpdate) GetRotateSecret() *bool { + if w == nil { return nil } - return o.RotateSecret + return w.RotateSecret } diff --git a/sdks/outpost-go/models/operations/createtenantdestination.go b/sdks/outpost-go/models/operations/createtenantdestination.go index 0676e2470..e1aaadd89 100644 --- a/sdks/outpost-go/models/operations/createtenantdestination.go +++ b/sdks/outpost-go/models/operations/createtenantdestination.go @@ -10,59 +10,63 @@ type CreateTenantDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *CreateTenantDestinationGlobals) GetTenantID() *string { - if o == nil { +func (c *CreateTenantDestinationGlobals) GetTenantID() *string { + if c == nil { return nil } - return o.TenantID + return c.TenantID } type CreateTenantDestinationRequest struct { // The ID of the tenant. Required when using AdminApiKey authentication. - TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` - DestinationCreate components.DestinationCreate `request:"mediaType=application/json"` + TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` + Params components.DestinationCreate `request:"mediaType=application/json"` } -func (o *CreateTenantDestinationRequest) GetTenantID() *string { - if o == nil { +func (c *CreateTenantDestinationRequest) GetTenantID() *string { + if c == nil { return nil } - return o.TenantID + return c.TenantID } -func (o *CreateTenantDestinationRequest) GetDestinationCreate() components.DestinationCreate { - if o == nil { +func (c *CreateTenantDestinationRequest) GetParams() components.DestinationCreate { + if c == nil { return components.DestinationCreate{} } - return o.DestinationCreate + return c.Params } -func (o *CreateTenantDestinationRequest) GetDestinationCreateWebhook() *components.DestinationCreateWebhook { - return o.GetDestinationCreate().DestinationCreateWebhook +func (c *CreateTenantDestinationRequest) GetParamsWebhook() *components.DestinationCreateWebhook { + return c.GetParams().DestinationCreateWebhook } -func (o *CreateTenantDestinationRequest) GetDestinationCreateAwsSqs() *components.DestinationCreateAWSSQS { - return o.GetDestinationCreate().DestinationCreateAWSSQS +func (c *CreateTenantDestinationRequest) GetParamsAwsSqs() *components.DestinationCreateAWSSQS { + return c.GetParams().DestinationCreateAWSSQS } -func (o *CreateTenantDestinationRequest) GetDestinationCreateRabbitmq() *components.DestinationCreateRabbitMQ { - return o.GetDestinationCreate().DestinationCreateRabbitMQ +func (c *CreateTenantDestinationRequest) GetParamsRabbitmq() *components.DestinationCreateRabbitMQ { + return c.GetParams().DestinationCreateRabbitMQ } -func (o *CreateTenantDestinationRequest) GetDestinationCreateHookdeck() *components.DestinationCreateHookdeck { - return o.GetDestinationCreate().DestinationCreateHookdeck +func (c *CreateTenantDestinationRequest) GetParamsHookdeck() *components.DestinationCreateHookdeck { + return c.GetParams().DestinationCreateHookdeck } -func (o *CreateTenantDestinationRequest) GetDestinationCreateAwsKinesis() *components.DestinationCreateAWSKinesis { - return o.GetDestinationCreate().DestinationCreateAWSKinesis +func (c *CreateTenantDestinationRequest) GetParamsAwsKinesis() *components.DestinationCreateAWSKinesis { + return c.GetParams().DestinationCreateAWSKinesis } -func (o *CreateTenantDestinationRequest) GetDestinationCreateAzureServicebus() *components.DestinationCreateAzureServiceBus { - return o.GetDestinationCreate().DestinationCreateAzureServiceBus +func (c *CreateTenantDestinationRequest) GetParamsAzureServicebus() *components.DestinationCreateAzureServiceBus { + return c.GetParams().DestinationCreateAzureServiceBus } -func (o *CreateTenantDestinationRequest) GetDestinationCreateAwsS3() *components.DestinationCreateAwss3 { - return o.GetDestinationCreate().DestinationCreateAwss3 +func (c *CreateTenantDestinationRequest) GetParamsAwsS3() *components.DestinationCreateAwss3 { + return c.GetParams().DestinationCreateAwss3 +} + +func (c *CreateTenantDestinationRequest) GetParamsGcpPubsub() *components.DestinationCreateGCPPubSub { + return c.GetParams().DestinationCreateGCPPubSub } type CreateTenantDestinationResponse struct { @@ -71,65 +75,72 @@ type CreateTenantDestinationResponse struct { Destination *components.Destination } -func (o *CreateTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (c *CreateTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if c == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return c.HTTPMeta } -func (o *CreateTenantDestinationResponse) GetDestination() *components.Destination { - if o == nil { +func (c *CreateTenantDestinationResponse) GetDestination() *components.Destination { + if c == nil { return nil } - return o.Destination + return c.Destination } -func (o *CreateTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { + if v := c.GetDestination(); v != nil { return v.DestinationWebhook } return nil } -func (o *CreateTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { + if v := c.GetDestination(); v != nil { return v.DestinationAWSSQS } return nil } -func (o *CreateTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { + if v := c.GetDestination(); v != nil { return v.DestinationRabbitMQ } return nil } -func (o *CreateTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { + if v := c.GetDestination(); v != nil { return v.DestinationHookdeck } return nil } -func (o *CreateTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { + if v := c.GetDestination(); v != nil { return v.DestinationAWSKinesis } return nil } -func (o *CreateTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { + if v := c.GetDestination(); v != nil { return v.DestinationAzureServiceBus } return nil } -func (o *CreateTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { - if v := o.GetDestination(); v != nil { +func (c *CreateTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { + if v := c.GetDestination(); v != nil { return v.DestinationAwss3 } return nil } + +func (c *CreateTenantDestinationResponse) GetDestinationGcpPubsub() *components.DestinationGCPPubSub { + if v := c.GetDestination(); v != nil { + return v.DestinationGCPPubSub + } + return nil +} diff --git a/sdks/outpost-go/models/operations/deletetenant.go b/sdks/outpost-go/models/operations/deletetenant.go index 34dcd3217..1be3fe6a8 100644 --- a/sdks/outpost-go/models/operations/deletetenant.go +++ b/sdks/outpost-go/models/operations/deletetenant.go @@ -10,11 +10,11 @@ type DeleteTenantGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *DeleteTenantGlobals) GetTenantID() *string { - if o == nil { +func (d *DeleteTenantGlobals) GetTenantID() *string { + if d == nil { return nil } - return o.TenantID + return d.TenantID } type DeleteTenantRequest struct { @@ -22,11 +22,11 @@ type DeleteTenantRequest struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *DeleteTenantRequest) GetTenantID() *string { - if o == nil { +func (d *DeleteTenantRequest) GetTenantID() *string { + if d == nil { return nil } - return o.TenantID + return d.TenantID } type DeleteTenantResponse struct { @@ -35,16 +35,16 @@ type DeleteTenantResponse struct { SuccessResponse *components.SuccessResponse } -func (o *DeleteTenantResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (d *DeleteTenantResponse) GetHTTPMeta() components.HTTPMetadata { + if d == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return d.HTTPMeta } -func (o *DeleteTenantResponse) GetSuccessResponse() *components.SuccessResponse { - if o == nil { +func (d *DeleteTenantResponse) GetSuccessResponse() *components.SuccessResponse { + if d == nil { return nil } - return o.SuccessResponse + return d.SuccessResponse } diff --git a/sdks/outpost-go/models/operations/deletetenantdestination.go b/sdks/outpost-go/models/operations/deletetenantdestination.go index 1d91a7324..a814ae9c7 100644 --- a/sdks/outpost-go/models/operations/deletetenantdestination.go +++ b/sdks/outpost-go/models/operations/deletetenantdestination.go @@ -10,11 +10,11 @@ type DeleteTenantDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *DeleteTenantDestinationGlobals) GetTenantID() *string { - if o == nil { +func (d *DeleteTenantDestinationGlobals) GetTenantID() *string { + if d == nil { return nil } - return o.TenantID + return d.TenantID } type DeleteTenantDestinationRequest struct { @@ -24,18 +24,18 @@ type DeleteTenantDestinationRequest struct { DestinationID string `pathParam:"style=simple,explode=false,name=destination_id"` } -func (o *DeleteTenantDestinationRequest) GetTenantID() *string { - if o == nil { +func (d *DeleteTenantDestinationRequest) GetTenantID() *string { + if d == nil { return nil } - return o.TenantID + return d.TenantID } -func (o *DeleteTenantDestinationRequest) GetDestinationID() string { - if o == nil { +func (d *DeleteTenantDestinationRequest) GetDestinationID() string { + if d == nil { return "" } - return o.DestinationID + return d.DestinationID } type DeleteTenantDestinationResponse struct { @@ -44,16 +44,16 @@ type DeleteTenantDestinationResponse struct { SuccessResponse *components.SuccessResponse } -func (o *DeleteTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (d *DeleteTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if d == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return d.HTTPMeta } -func (o *DeleteTenantDestinationResponse) GetSuccessResponse() *components.SuccessResponse { - if o == nil { +func (d *DeleteTenantDestinationResponse) GetSuccessResponse() *components.SuccessResponse { + if d == nil { return nil } - return o.SuccessResponse + return d.SuccessResponse } diff --git a/sdks/outpost-go/models/operations/disabletenantdestination.go b/sdks/outpost-go/models/operations/disabletenantdestination.go index 4932a0786..2b9f67108 100644 --- a/sdks/outpost-go/models/operations/disabletenantdestination.go +++ b/sdks/outpost-go/models/operations/disabletenantdestination.go @@ -10,11 +10,11 @@ type DisableTenantDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *DisableTenantDestinationGlobals) GetTenantID() *string { - if o == nil { +func (d *DisableTenantDestinationGlobals) GetTenantID() *string { + if d == nil { return nil } - return o.TenantID + return d.TenantID } type DisableTenantDestinationRequest struct { @@ -24,18 +24,18 @@ type DisableTenantDestinationRequest struct { DestinationID string `pathParam:"style=simple,explode=false,name=destination_id"` } -func (o *DisableTenantDestinationRequest) GetTenantID() *string { - if o == nil { +func (d *DisableTenantDestinationRequest) GetTenantID() *string { + if d == nil { return nil } - return o.TenantID + return d.TenantID } -func (o *DisableTenantDestinationRequest) GetDestinationID() string { - if o == nil { +func (d *DisableTenantDestinationRequest) GetDestinationID() string { + if d == nil { return "" } - return o.DestinationID + return d.DestinationID } type DisableTenantDestinationResponse struct { @@ -44,65 +44,72 @@ type DisableTenantDestinationResponse struct { Destination *components.Destination } -func (o *DisableTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (d *DisableTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if d == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return d.HTTPMeta } -func (o *DisableTenantDestinationResponse) GetDestination() *components.Destination { - if o == nil { +func (d *DisableTenantDestinationResponse) GetDestination() *components.Destination { + if d == nil { return nil } - return o.Destination + return d.Destination } -func (o *DisableTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { + if v := d.GetDestination(); v != nil { return v.DestinationWebhook } return nil } -func (o *DisableTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { + if v := d.GetDestination(); v != nil { return v.DestinationAWSSQS } return nil } -func (o *DisableTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { + if v := d.GetDestination(); v != nil { return v.DestinationRabbitMQ } return nil } -func (o *DisableTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { + if v := d.GetDestination(); v != nil { return v.DestinationHookdeck } return nil } -func (o *DisableTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { + if v := d.GetDestination(); v != nil { return v.DestinationAWSKinesis } return nil } -func (o *DisableTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { + if v := d.GetDestination(); v != nil { return v.DestinationAzureServiceBus } return nil } -func (o *DisableTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { - if v := o.GetDestination(); v != nil { +func (d *DisableTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { + if v := d.GetDestination(); v != nil { return v.DestinationAwss3 } return nil } + +func (d *DisableTenantDestinationResponse) GetDestinationGcpPubsub() *components.DestinationGCPPubSub { + if v := d.GetDestination(); v != nil { + return v.DestinationGCPPubSub + } + return nil +} diff --git a/sdks/outpost-go/models/operations/enabletenantdestination.go b/sdks/outpost-go/models/operations/enabletenantdestination.go index 83a21be39..4ef6bcf65 100644 --- a/sdks/outpost-go/models/operations/enabletenantdestination.go +++ b/sdks/outpost-go/models/operations/enabletenantdestination.go @@ -10,11 +10,11 @@ type EnableTenantDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *EnableTenantDestinationGlobals) GetTenantID() *string { - if o == nil { +func (e *EnableTenantDestinationGlobals) GetTenantID() *string { + if e == nil { return nil } - return o.TenantID + return e.TenantID } type EnableTenantDestinationRequest struct { @@ -24,18 +24,18 @@ type EnableTenantDestinationRequest struct { DestinationID string `pathParam:"style=simple,explode=false,name=destination_id"` } -func (o *EnableTenantDestinationRequest) GetTenantID() *string { - if o == nil { +func (e *EnableTenantDestinationRequest) GetTenantID() *string { + if e == nil { return nil } - return o.TenantID + return e.TenantID } -func (o *EnableTenantDestinationRequest) GetDestinationID() string { - if o == nil { +func (e *EnableTenantDestinationRequest) GetDestinationID() string { + if e == nil { return "" } - return o.DestinationID + return e.DestinationID } type EnableTenantDestinationResponse struct { @@ -44,65 +44,72 @@ type EnableTenantDestinationResponse struct { Destination *components.Destination } -func (o *EnableTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (e *EnableTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if e == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return e.HTTPMeta } -func (o *EnableTenantDestinationResponse) GetDestination() *components.Destination { - if o == nil { +func (e *EnableTenantDestinationResponse) GetDestination() *components.Destination { + if e == nil { return nil } - return o.Destination + return e.Destination } -func (o *EnableTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { + if v := e.GetDestination(); v != nil { return v.DestinationWebhook } return nil } -func (o *EnableTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { + if v := e.GetDestination(); v != nil { return v.DestinationAWSSQS } return nil } -func (o *EnableTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { + if v := e.GetDestination(); v != nil { return v.DestinationRabbitMQ } return nil } -func (o *EnableTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { + if v := e.GetDestination(); v != nil { return v.DestinationHookdeck } return nil } -func (o *EnableTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { + if v := e.GetDestination(); v != nil { return v.DestinationAWSKinesis } return nil } -func (o *EnableTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { + if v := e.GetDestination(); v != nil { return v.DestinationAzureServiceBus } return nil } -func (o *EnableTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { - if v := o.GetDestination(); v != nil { +func (e *EnableTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { + if v := e.GetDestination(); v != nil { return v.DestinationAwss3 } return nil } + +func (e *EnableTenantDestinationResponse) GetDestinationGcpPubsub() *components.DestinationGCPPubSub { + if v := e.GetDestination(); v != nil { + return v.DestinationGCPPubSub + } + return nil +} diff --git a/sdks/outpost-go/models/operations/getdestinationtypeschema.go b/sdks/outpost-go/models/operations/getdestinationtypeschema.go index 9ca9221d8..9aae18fe0 100644 --- a/sdks/outpost-go/models/operations/getdestinationtypeschema.go +++ b/sdks/outpost-go/models/operations/getdestinationtypeschema.go @@ -52,11 +52,11 @@ type GetDestinationTypeSchemaRequest struct { Type GetDestinationTypeSchemaType `pathParam:"style=simple,explode=false,name=type"` } -func (o *GetDestinationTypeSchemaRequest) GetType() GetDestinationTypeSchemaType { - if o == nil { +func (g *GetDestinationTypeSchemaRequest) GetType() GetDestinationTypeSchemaType { + if g == nil { return GetDestinationTypeSchemaType("") } - return o.Type + return g.Type } type GetDestinationTypeSchemaResponse struct { @@ -65,16 +65,16 @@ type GetDestinationTypeSchemaResponse struct { DestinationTypeSchema *components.DestinationTypeSchema } -func (o *GetDestinationTypeSchemaResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetDestinationTypeSchemaResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetDestinationTypeSchemaResponse) GetDestinationTypeSchema() *components.DestinationTypeSchema { - if o == nil { +func (g *GetDestinationTypeSchemaResponse) GetDestinationTypeSchema() *components.DestinationTypeSchema { + if g == nil { return nil } - return o.DestinationTypeSchema + return g.DestinationTypeSchema } diff --git a/sdks/outpost-go/models/operations/gettenant.go b/sdks/outpost-go/models/operations/gettenant.go index e3711ae10..74a2ae198 100644 --- a/sdks/outpost-go/models/operations/gettenant.go +++ b/sdks/outpost-go/models/operations/gettenant.go @@ -10,11 +10,11 @@ type GetTenantGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantRequest struct { @@ -22,11 +22,11 @@ type GetTenantRequest struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantResponse struct { @@ -35,16 +35,16 @@ type GetTenantResponse struct { Tenant *components.Tenant } -func (o *GetTenantResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantResponse) GetTenant() *components.Tenant { - if o == nil { +func (g *GetTenantResponse) GetTenant() *components.Tenant { + if g == nil { return nil } - return o.Tenant + return g.Tenant } diff --git a/sdks/outpost-go/models/operations/gettenantdestination.go b/sdks/outpost-go/models/operations/gettenantdestination.go index 3c388deab..97400dc03 100644 --- a/sdks/outpost-go/models/operations/gettenantdestination.go +++ b/sdks/outpost-go/models/operations/gettenantdestination.go @@ -10,11 +10,11 @@ type GetTenantDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantDestinationGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantDestinationGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantDestinationRequest struct { @@ -24,18 +24,18 @@ type GetTenantDestinationRequest struct { DestinationID string `pathParam:"style=simple,explode=false,name=destination_id"` } -func (o *GetTenantDestinationRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantDestinationRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } -func (o *GetTenantDestinationRequest) GetDestinationID() string { - if o == nil { +func (g *GetTenantDestinationRequest) GetDestinationID() string { + if g == nil { return "" } - return o.DestinationID + return g.DestinationID } type GetTenantDestinationResponse struct { @@ -44,65 +44,72 @@ type GetTenantDestinationResponse struct { Destination *components.Destination } -func (o *GetTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantDestinationResponse) GetDestination() *components.Destination { - if o == nil { +func (g *GetTenantDestinationResponse) GetDestination() *components.Destination { + if g == nil { return nil } - return o.Destination + return g.Destination } -func (o *GetTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationWebhook() *components.DestinationWebhook { + if v := g.GetDestination(); v != nil { return v.DestinationWebhook } return nil } -func (o *GetTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationAwsSqs() *components.DestinationAWSSQS { + if v := g.GetDestination(); v != nil { return v.DestinationAWSSQS } return nil } -func (o *GetTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationRabbitmq() *components.DestinationRabbitMQ { + if v := g.GetDestination(); v != nil { return v.DestinationRabbitMQ } return nil } -func (o *GetTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationHookdeck() *components.DestinationHookdeck { + if v := g.GetDestination(); v != nil { return v.DestinationHookdeck } return nil } -func (o *GetTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationAwsKinesis() *components.DestinationAWSKinesis { + if v := g.GetDestination(); v != nil { return v.DestinationAWSKinesis } return nil } -func (o *GetTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationAzureServicebus() *components.DestinationAzureServiceBus { + if v := g.GetDestination(); v != nil { return v.DestinationAzureServiceBus } return nil } -func (o *GetTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { - if v := o.GetDestination(); v != nil { +func (g *GetTenantDestinationResponse) GetDestinationAwsS3() *components.DestinationAwss3 { + if v := g.GetDestination(); v != nil { return v.DestinationAwss3 } return nil } + +func (g *GetTenantDestinationResponse) GetDestinationGcpPubsub() *components.DestinationGCPPubSub { + if v := g.GetDestination(); v != nil { + return v.DestinationGCPPubSub + } + return nil +} diff --git a/sdks/outpost-go/models/operations/gettenantdestinationtypeschema.go b/sdks/outpost-go/models/operations/gettenantdestinationtypeschema.go index 0c25e844f..c76fb5dae 100644 --- a/sdks/outpost-go/models/operations/gettenantdestinationtypeschema.go +++ b/sdks/outpost-go/models/operations/gettenantdestinationtypeschema.go @@ -12,11 +12,11 @@ type GetTenantDestinationTypeSchemaGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantDestinationTypeSchemaGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantDestinationTypeSchemaGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } // GetTenantDestinationTypeSchemaType - The type of the destination. @@ -65,18 +65,18 @@ type GetTenantDestinationTypeSchemaRequest struct { Type GetTenantDestinationTypeSchemaType `pathParam:"style=simple,explode=false,name=type"` } -func (o *GetTenantDestinationTypeSchemaRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantDestinationTypeSchemaRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } -func (o *GetTenantDestinationTypeSchemaRequest) GetType() GetTenantDestinationTypeSchemaType { - if o == nil { +func (g *GetTenantDestinationTypeSchemaRequest) GetType() GetTenantDestinationTypeSchemaType { + if g == nil { return GetTenantDestinationTypeSchemaType("") } - return o.Type + return g.Type } type GetTenantDestinationTypeSchemaResponse struct { @@ -85,16 +85,16 @@ type GetTenantDestinationTypeSchemaResponse struct { DestinationTypeSchema *components.DestinationTypeSchema } -func (o *GetTenantDestinationTypeSchemaResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantDestinationTypeSchemaResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantDestinationTypeSchemaResponse) GetDestinationTypeSchema() *components.DestinationTypeSchema { - if o == nil { +func (g *GetTenantDestinationTypeSchemaResponse) GetDestinationTypeSchema() *components.DestinationTypeSchema { + if g == nil { return nil } - return o.DestinationTypeSchema + return g.DestinationTypeSchema } diff --git a/sdks/outpost-go/models/operations/gettenantevent.go b/sdks/outpost-go/models/operations/gettenantevent.go index a2d08a560..b4d74ef3d 100644 --- a/sdks/outpost-go/models/operations/gettenantevent.go +++ b/sdks/outpost-go/models/operations/gettenantevent.go @@ -10,11 +10,11 @@ type GetTenantEventGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantEventGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantEventGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantEventRequest struct { @@ -24,18 +24,18 @@ type GetTenantEventRequest struct { EventID string `pathParam:"style=simple,explode=false,name=event_id"` } -func (o *GetTenantEventRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantEventRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } -func (o *GetTenantEventRequest) GetEventID() string { - if o == nil { +func (g *GetTenantEventRequest) GetEventID() string { + if g == nil { return "" } - return o.EventID + return g.EventID } type GetTenantEventResponse struct { @@ -44,16 +44,16 @@ type GetTenantEventResponse struct { Event *components.Event } -func (o *GetTenantEventResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantEventResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantEventResponse) GetEvent() *components.Event { - if o == nil { +func (g *GetTenantEventResponse) GetEvent() *components.Event { + if g == nil { return nil } - return o.Event + return g.Event } diff --git a/sdks/outpost-go/models/operations/gettenanteventbydestination.go b/sdks/outpost-go/models/operations/gettenanteventbydestination.go index 908fc7f23..6bea3a71a 100644 --- a/sdks/outpost-go/models/operations/gettenanteventbydestination.go +++ b/sdks/outpost-go/models/operations/gettenanteventbydestination.go @@ -10,11 +10,11 @@ type GetTenantEventByDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantEventByDestinationGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantEventByDestinationGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantEventByDestinationRequest struct { @@ -26,25 +26,25 @@ type GetTenantEventByDestinationRequest struct { EventID string `pathParam:"style=simple,explode=false,name=event_id"` } -func (o *GetTenantEventByDestinationRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantEventByDestinationRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } -func (o *GetTenantEventByDestinationRequest) GetDestinationID() string { - if o == nil { +func (g *GetTenantEventByDestinationRequest) GetDestinationID() string { + if g == nil { return "" } - return o.DestinationID + return g.DestinationID } -func (o *GetTenantEventByDestinationRequest) GetEventID() string { - if o == nil { +func (g *GetTenantEventByDestinationRequest) GetEventID() string { + if g == nil { return "" } - return o.EventID + return g.EventID } type GetTenantEventByDestinationResponse struct { @@ -53,16 +53,16 @@ type GetTenantEventByDestinationResponse struct { Event *components.Event } -func (o *GetTenantEventByDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantEventByDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantEventByDestinationResponse) GetEvent() *components.Event { - if o == nil { +func (g *GetTenantEventByDestinationResponse) GetEvent() *components.Event { + if g == nil { return nil } - return o.Event + return g.Event } diff --git a/sdks/outpost-go/models/operations/gettenantportalurl.go b/sdks/outpost-go/models/operations/gettenantportalurl.go index 1f43ae13f..276dfb757 100644 --- a/sdks/outpost-go/models/operations/gettenantportalurl.go +++ b/sdks/outpost-go/models/operations/gettenantportalurl.go @@ -12,11 +12,11 @@ type GetTenantPortalURLGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantPortalURLGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantPortalURLGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } // Theme - Optional theme preference for the portal. @@ -53,18 +53,18 @@ type GetTenantPortalURLRequest struct { Theme *Theme `queryParam:"style=form,explode=true,name=theme"` } -func (o *GetTenantPortalURLRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantPortalURLRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } -func (o *GetTenantPortalURLRequest) GetTheme() *Theme { - if o == nil { +func (g *GetTenantPortalURLRequest) GetTheme() *Theme { + if g == nil { return nil } - return o.Theme + return g.Theme } type GetTenantPortalURLResponse struct { @@ -73,16 +73,16 @@ type GetTenantPortalURLResponse struct { PortalRedirect *components.PortalRedirect } -func (o *GetTenantPortalURLResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantPortalURLResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantPortalURLResponse) GetPortalRedirect() *components.PortalRedirect { - if o == nil { +func (g *GetTenantPortalURLResponse) GetPortalRedirect() *components.PortalRedirect { + if g == nil { return nil } - return o.PortalRedirect + return g.PortalRedirect } diff --git a/sdks/outpost-go/models/operations/gettenanttoken.go b/sdks/outpost-go/models/operations/gettenanttoken.go index ceb83e580..6a2ca8b89 100644 --- a/sdks/outpost-go/models/operations/gettenanttoken.go +++ b/sdks/outpost-go/models/operations/gettenanttoken.go @@ -10,11 +10,11 @@ type GetTenantTokenGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantTokenGlobals) GetTenantID() *string { - if o == nil { +func (g *GetTenantTokenGlobals) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantTokenRequest struct { @@ -22,11 +22,11 @@ type GetTenantTokenRequest struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *GetTenantTokenRequest) GetTenantID() *string { - if o == nil { +func (g *GetTenantTokenRequest) GetTenantID() *string { + if g == nil { return nil } - return o.TenantID + return g.TenantID } type GetTenantTokenResponse struct { @@ -35,16 +35,16 @@ type GetTenantTokenResponse struct { TenantToken *components.TenantToken } -func (o *GetTenantTokenResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (g *GetTenantTokenResponse) GetHTTPMeta() components.HTTPMetadata { + if g == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return g.HTTPMeta } -func (o *GetTenantTokenResponse) GetTenantToken() *components.TenantToken { - if o == nil { +func (g *GetTenantTokenResponse) GetTenantToken() *components.TenantToken { + if g == nil { return nil } - return o.TenantToken + return g.TenantToken } diff --git a/sdks/outpost-go/models/operations/healthcheck.go b/sdks/outpost-go/models/operations/healthcheck.go index a36880fcb..0dd35327c 100644 --- a/sdks/outpost-go/models/operations/healthcheck.go +++ b/sdks/outpost-go/models/operations/healthcheck.go @@ -3,25 +3,126 @@ package operations import ( + "encoding/json" + "fmt" + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" "github.com/hookdeck/outpost/sdks/outpost-go/models/components" + "time" ) +type HealthCheckStatus1 string + +const ( + HealthCheckStatus1Healthy HealthCheckStatus1 = "healthy" +) + +func (e HealthCheckStatus1) ToPointer() *HealthCheckStatus1 { + return &e +} +func (e *HealthCheckStatus1) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "healthy": + *e = HealthCheckStatus1(v) + return nil + default: + return fmt.Errorf("invalid value for HealthCheckStatus1: %v", v) + } +} + +type HealthCheckStatus2 string + +const ( + HealthCheckStatus2Healthy HealthCheckStatus2 = "healthy" +) + +func (e HealthCheckStatus2) ToPointer() *HealthCheckStatus2 { + return &e +} +func (e *HealthCheckStatus2) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "healthy": + *e = HealthCheckStatus2(v) + return nil + default: + return fmt.Errorf("invalid value for HealthCheckStatus2: %v", v) + } +} + +type Workers struct { + Status HealthCheckStatus2 `json:"status"` +} + +func (w *Workers) GetStatus() HealthCheckStatus2 { + if w == nil { + return HealthCheckStatus2("") + } + return w.Status +} + +// HealthCheckResponseBody - Service is healthy - all workers are operational. +type HealthCheckResponseBody struct { + Status HealthCheckStatus1 `json:"status"` + // When this health check was performed + Timestamp time.Time `json:"timestamp"` + Workers map[string]Workers `json:"workers"` +} + +func (h HealthCheckResponseBody) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(h, "", false) +} + +func (h *HealthCheckResponseBody) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &h, "", false, nil); err != nil { + return err + } + return nil +} + +func (h *HealthCheckResponseBody) GetStatus() HealthCheckStatus1 { + if h == nil { + return HealthCheckStatus1("") + } + return h.Status +} + +func (h *HealthCheckResponseBody) GetTimestamp() time.Time { + if h == nil { + return time.Time{} + } + return h.Timestamp +} + +func (h *HealthCheckResponseBody) GetWorkers() map[string]Workers { + if h == nil { + return map[string]Workers{} + } + return h.Workers +} + type HealthCheckResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` - // Service is healthy. - Res *string + // Service is healthy - all workers are operational. + Object *HealthCheckResponseBody } -func (o *HealthCheckResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (h *HealthCheckResponse) GetHTTPMeta() components.HTTPMetadata { + if h == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return h.HTTPMeta } -func (o *HealthCheckResponse) GetRes() *string { - if o == nil { +func (h *HealthCheckResponse) GetObject() *HealthCheckResponseBody { + if h == nil { return nil } - return o.Res + return h.Object } diff --git a/sdks/outpost-go/models/operations/listdestinationtypeschemasjwt.go b/sdks/outpost-go/models/operations/listdestinationtypeschemasjwt.go index e609dea06..cc91b0022 100644 --- a/sdks/outpost-go/models/operations/listdestinationtypeschemasjwt.go +++ b/sdks/outpost-go/models/operations/listdestinationtypeschemasjwt.go @@ -12,16 +12,16 @@ type ListDestinationTypeSchemasJwtResponse struct { DestinationTypeSchemas []components.DestinationTypeSchema } -func (o *ListDestinationTypeSchemasJwtResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListDestinationTypeSchemasJwtResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListDestinationTypeSchemasJwtResponse) GetDestinationTypeSchemas() []components.DestinationTypeSchema { - if o == nil { +func (l *ListDestinationTypeSchemasJwtResponse) GetDestinationTypeSchemas() []components.DestinationTypeSchema { + if l == nil { return nil } - return o.DestinationTypeSchemas + return l.DestinationTypeSchemas } diff --git a/sdks/outpost-go/models/operations/listtenantdestinations.go b/sdks/outpost-go/models/operations/listtenantdestinations.go index 09b1ba26b..d20a8708a 100644 --- a/sdks/outpost-go/models/operations/listtenantdestinations.go +++ b/sdks/outpost-go/models/operations/listtenantdestinations.go @@ -3,7 +3,6 @@ package operations import ( - "encoding/json" "errors" "fmt" "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" @@ -14,151 +13,75 @@ type ListTenantDestinationsGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantDestinationsGlobals) GetTenantID() *string { - if o == nil { +func (l *ListTenantDestinationsGlobals) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } -type ListTenantDestinationsTypeEnum2 string +type ListTenantDestinationsTypeType string const ( - ListTenantDestinationsTypeEnum2Webhook ListTenantDestinationsTypeEnum2 = "webhook" - ListTenantDestinationsTypeEnum2AwsSqs ListTenantDestinationsTypeEnum2 = "aws_sqs" - ListTenantDestinationsTypeEnum2Rabbitmq ListTenantDestinationsTypeEnum2 = "rabbitmq" - ListTenantDestinationsTypeEnum2Hookdeck ListTenantDestinationsTypeEnum2 = "hookdeck" - ListTenantDestinationsTypeEnum2AwsKinesis ListTenantDestinationsTypeEnum2 = "aws_kinesis" - ListTenantDestinationsTypeEnum2AwsS3 ListTenantDestinationsTypeEnum2 = "aws_s3" + ListTenantDestinationsTypeTypeDestinationType ListTenantDestinationsTypeType = "DestinationType" + ListTenantDestinationsTypeTypeArrayOfDestinationType ListTenantDestinationsTypeType = "arrayOfDestinationType" ) -func (e ListTenantDestinationsTypeEnum2) ToPointer() *ListTenantDestinationsTypeEnum2 { - return &e -} -func (e *ListTenantDestinationsTypeEnum2) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "webhook": - fallthrough - case "aws_sqs": - fallthrough - case "rabbitmq": - fallthrough - case "hookdeck": - fallthrough - case "aws_kinesis": - fallthrough - case "aws_s3": - *e = ListTenantDestinationsTypeEnum2(v) - return nil - default: - return fmt.Errorf("invalid value for ListTenantDestinationsTypeEnum2: %v", v) - } -} - -type ListTenantDestinationsTypeEnum1 string - -const ( - ListTenantDestinationsTypeEnum1Webhook ListTenantDestinationsTypeEnum1 = "webhook" - ListTenantDestinationsTypeEnum1AwsSqs ListTenantDestinationsTypeEnum1 = "aws_sqs" - ListTenantDestinationsTypeEnum1Rabbitmq ListTenantDestinationsTypeEnum1 = "rabbitmq" - ListTenantDestinationsTypeEnum1Hookdeck ListTenantDestinationsTypeEnum1 = "hookdeck" - ListTenantDestinationsTypeEnum1AwsKinesis ListTenantDestinationsTypeEnum1 = "aws_kinesis" - ListTenantDestinationsTypeEnum1AwsS3 ListTenantDestinationsTypeEnum1 = "aws_s3" -) - -func (e ListTenantDestinationsTypeEnum1) ToPointer() *ListTenantDestinationsTypeEnum1 { - return &e -} -func (e *ListTenantDestinationsTypeEnum1) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "webhook": - fallthrough - case "aws_sqs": - fallthrough - case "rabbitmq": - fallthrough - case "hookdeck": - fallthrough - case "aws_kinesis": - fallthrough - case "aws_s3": - *e = ListTenantDestinationsTypeEnum1(v) - return nil - default: - return fmt.Errorf("invalid value for ListTenantDestinationsTypeEnum1: %v", v) - } -} - -type TypeType string - -const ( - TypeTypeListTenantDestinationsTypeEnum1 TypeType = "listTenantDestinations_type_enum_1" - TypeTypeArrayOfListTenantDestinationsTypeEnum2 TypeType = "arrayOfListTenantDestinationsTypeEnum2" -) - -// Type - Filter destinations by type(s). -type Type struct { - ListTenantDestinationsTypeEnum1 *ListTenantDestinationsTypeEnum1 `queryParam:"inline" name:"type"` - ArrayOfListTenantDestinationsTypeEnum2 []ListTenantDestinationsTypeEnum2 `queryParam:"inline" name:"type"` +// ListTenantDestinationsType - Filter destinations by type(s). +type ListTenantDestinationsType struct { + DestinationType *components.DestinationType `queryParam:"inline" union:"member"` + ArrayOfDestinationType []components.DestinationType `queryParam:"inline" union:"member"` - Type TypeType + Type ListTenantDestinationsTypeType } -func CreateTypeListTenantDestinationsTypeEnum1(listTenantDestinationsTypeEnum1 ListTenantDestinationsTypeEnum1) Type { - typ := TypeTypeListTenantDestinationsTypeEnum1 +func CreateListTenantDestinationsTypeDestinationType(destinationType components.DestinationType) ListTenantDestinationsType { + typ := ListTenantDestinationsTypeTypeDestinationType - return Type{ - ListTenantDestinationsTypeEnum1: &listTenantDestinationsTypeEnum1, - Type: typ, + return ListTenantDestinationsType{ + DestinationType: &destinationType, + Type: typ, } } -func CreateTypeArrayOfListTenantDestinationsTypeEnum2(arrayOfListTenantDestinationsTypeEnum2 []ListTenantDestinationsTypeEnum2) Type { - typ := TypeTypeArrayOfListTenantDestinationsTypeEnum2 +func CreateListTenantDestinationsTypeArrayOfDestinationType(arrayOfDestinationType []components.DestinationType) ListTenantDestinationsType { + typ := ListTenantDestinationsTypeTypeArrayOfDestinationType - return Type{ - ArrayOfListTenantDestinationsTypeEnum2: arrayOfListTenantDestinationsTypeEnum2, - Type: typ, + return ListTenantDestinationsType{ + ArrayOfDestinationType: arrayOfDestinationType, + Type: typ, } } -func (u *Type) UnmarshalJSON(data []byte) error { +func (u *ListTenantDestinationsType) UnmarshalJSON(data []byte) error { - var listTenantDestinationsTypeEnum1 ListTenantDestinationsTypeEnum1 = ListTenantDestinationsTypeEnum1("") - if err := utils.UnmarshalJSON(data, &listTenantDestinationsTypeEnum1, "", true, nil); err == nil { - u.ListTenantDestinationsTypeEnum1 = &listTenantDestinationsTypeEnum1 - u.Type = TypeTypeListTenantDestinationsTypeEnum1 + var destinationType components.DestinationType = components.DestinationType("") + if err := utils.UnmarshalJSON(data, &destinationType, "", true, nil); err == nil { + u.DestinationType = &destinationType + u.Type = ListTenantDestinationsTypeTypeDestinationType return nil } - var arrayOfListTenantDestinationsTypeEnum2 []ListTenantDestinationsTypeEnum2 = []ListTenantDestinationsTypeEnum2{} - if err := utils.UnmarshalJSON(data, &arrayOfListTenantDestinationsTypeEnum2, "", true, nil); err == nil { - u.ArrayOfListTenantDestinationsTypeEnum2 = arrayOfListTenantDestinationsTypeEnum2 - u.Type = TypeTypeArrayOfListTenantDestinationsTypeEnum2 + var arrayOfDestinationType []components.DestinationType = []components.DestinationType{} + if err := utils.UnmarshalJSON(data, &arrayOfDestinationType, "", true, nil); err == nil { + u.ArrayOfDestinationType = arrayOfDestinationType + u.Type = ListTenantDestinationsTypeTypeArrayOfDestinationType return nil } - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Type", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for ListTenantDestinationsType", string(data)) } -func (u Type) MarshalJSON() ([]byte, error) { - if u.ListTenantDestinationsTypeEnum1 != nil { - return utils.MarshalJSON(u.ListTenantDestinationsTypeEnum1, "", true) +func (u ListTenantDestinationsType) MarshalJSON() ([]byte, error) { + if u.DestinationType != nil { + return utils.MarshalJSON(u.DestinationType, "", true) } - if u.ArrayOfListTenantDestinationsTypeEnum2 != nil { - return utils.MarshalJSON(u.ArrayOfListTenantDestinationsTypeEnum2, "", true) + if u.ArrayOfDestinationType != nil { + return utils.MarshalJSON(u.ArrayOfDestinationType, "", true) } - return nil, errors.New("could not marshal union type Type: all fields are null") + return nil, errors.New("could not marshal union type ListTenantDestinationsType: all fields are null") } type TopicsType string @@ -170,8 +93,8 @@ const ( // Topics - Filter destinations by supported topic(s). type Topics struct { - Str *string `queryParam:"inline" name:"topics"` - ArrayOfStr []string `queryParam:"inline" name:"topics"` + Str *string `queryParam:"inline" union:"member"` + ArrayOfStr []string `queryParam:"inline" union:"member"` Type TopicsType } @@ -229,30 +152,30 @@ type ListTenantDestinationsRequest struct { // The ID of the tenant. Required when using AdminApiKey authentication. TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` // Filter destinations by type(s). - Type *Type `queryParam:"style=form,explode=true,name=type"` + Type *ListTenantDestinationsType `queryParam:"style=form,explode=true,name=type"` // Filter destinations by supported topic(s). Topics *Topics `queryParam:"style=form,explode=true,name=topics"` } -func (o *ListTenantDestinationsRequest) GetTenantID() *string { - if o == nil { +func (l *ListTenantDestinationsRequest) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } -func (o *ListTenantDestinationsRequest) GetType() *Type { - if o == nil { +func (l *ListTenantDestinationsRequest) GetType() *ListTenantDestinationsType { + if l == nil { return nil } - return o.Type + return l.Type } -func (o *ListTenantDestinationsRequest) GetTopics() *Topics { - if o == nil { +func (l *ListTenantDestinationsRequest) GetTopics() *Topics { + if l == nil { return nil } - return o.Topics + return l.Topics } type ListTenantDestinationsResponse struct { @@ -261,16 +184,16 @@ type ListTenantDestinationsResponse struct { Destinations []components.Destination } -func (o *ListTenantDestinationsResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTenantDestinationsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTenantDestinationsResponse) GetDestinations() []components.Destination { - if o == nil { +func (l *ListTenantDestinationsResponse) GetDestinations() []components.Destination { + if l == nil { return nil } - return o.Destinations + return l.Destinations } diff --git a/sdks/outpost-go/models/operations/listtenantdestinationtypeschemas.go b/sdks/outpost-go/models/operations/listtenantdestinationtypeschemas.go index b26ed9bc3..731c2c3cd 100644 --- a/sdks/outpost-go/models/operations/listtenantdestinationtypeschemas.go +++ b/sdks/outpost-go/models/operations/listtenantdestinationtypeschemas.go @@ -10,11 +10,11 @@ type ListTenantDestinationTypeSchemasGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantDestinationTypeSchemasGlobals) GetTenantID() *string { - if o == nil { +func (l *ListTenantDestinationTypeSchemasGlobals) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } type ListTenantDestinationTypeSchemasRequest struct { @@ -22,11 +22,11 @@ type ListTenantDestinationTypeSchemasRequest struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantDestinationTypeSchemasRequest) GetTenantID() *string { - if o == nil { +func (l *ListTenantDestinationTypeSchemasRequest) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } type ListTenantDestinationTypeSchemasResponse struct { @@ -35,16 +35,16 @@ type ListTenantDestinationTypeSchemasResponse struct { DestinationTypeSchemas []components.DestinationTypeSchema } -func (o *ListTenantDestinationTypeSchemasResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTenantDestinationTypeSchemasResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTenantDestinationTypeSchemasResponse) GetDestinationTypeSchemas() []components.DestinationTypeSchema { - if o == nil { +func (l *ListTenantDestinationTypeSchemasResponse) GetDestinationTypeSchemas() []components.DestinationTypeSchema { + if l == nil { return nil } - return o.DestinationTypeSchemas + return l.DestinationTypeSchemas } diff --git a/sdks/outpost-go/models/operations/listtenanteventdeliveries.go b/sdks/outpost-go/models/operations/listtenanteventdeliveries.go index b9ae99507..da3142762 100644 --- a/sdks/outpost-go/models/operations/listtenanteventdeliveries.go +++ b/sdks/outpost-go/models/operations/listtenanteventdeliveries.go @@ -10,11 +10,11 @@ type ListTenantEventDeliveriesGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantEventDeliveriesGlobals) GetTenantID() *string { - if o == nil { +func (l *ListTenantEventDeliveriesGlobals) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } type ListTenantEventDeliveriesRequest struct { @@ -24,18 +24,18 @@ type ListTenantEventDeliveriesRequest struct { EventID string `pathParam:"style=simple,explode=false,name=event_id"` } -func (o *ListTenantEventDeliveriesRequest) GetTenantID() *string { - if o == nil { +func (l *ListTenantEventDeliveriesRequest) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } -func (o *ListTenantEventDeliveriesRequest) GetEventID() string { - if o == nil { +func (l *ListTenantEventDeliveriesRequest) GetEventID() string { + if l == nil { return "" } - return o.EventID + return l.EventID } type ListTenantEventDeliveriesResponse struct { @@ -44,16 +44,16 @@ type ListTenantEventDeliveriesResponse struct { DeliveryAttempts []components.DeliveryAttempt } -func (o *ListTenantEventDeliveriesResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTenantEventDeliveriesResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTenantEventDeliveriesResponse) GetDeliveryAttempts() []components.DeliveryAttempt { - if o == nil { +func (l *ListTenantEventDeliveriesResponse) GetDeliveryAttempts() []components.DeliveryAttempt { + if l == nil { return nil } - return o.DeliveryAttempts + return l.DeliveryAttempts } diff --git a/sdks/outpost-go/models/operations/listtenantevents.go b/sdks/outpost-go/models/operations/listtenantevents.go index efa38c4b5..9537c52d3 100644 --- a/sdks/outpost-go/models/operations/listtenantevents.go +++ b/sdks/outpost-go/models/operations/listtenantevents.go @@ -15,11 +15,11 @@ type ListTenantEventsGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantEventsGlobals) GetTenantID() *string { - if o == nil { +func (l *ListTenantEventsGlobals) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } type DestinationIDType string @@ -31,8 +31,8 @@ const ( // DestinationID - Filter events by destination ID(s). type DestinationID struct { - Str *string `queryParam:"inline" name:"destination_id"` - ArrayOfStr []string `queryParam:"inline" name:"destination_id"` + Str *string `queryParam:"inline" union:"member"` + ArrayOfStr []string `queryParam:"inline" union:"member"` Type DestinationIDType } @@ -143,60 +143,60 @@ func (l *ListTenantEventsRequest) UnmarshalJSON(data []byte) error { return nil } -func (o *ListTenantEventsRequest) GetTenantID() *string { - if o == nil { +func (l *ListTenantEventsRequest) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } -func (o *ListTenantEventsRequest) GetDestinationID() *DestinationID { - if o == nil { +func (l *ListTenantEventsRequest) GetDestinationID() *DestinationID { + if l == nil { return nil } - return o.DestinationID + return l.DestinationID } -func (o *ListTenantEventsRequest) GetStatus() *ListTenantEventsStatus { - if o == nil { +func (l *ListTenantEventsRequest) GetStatus() *ListTenantEventsStatus { + if l == nil { return nil } - return o.Status + return l.Status } -func (o *ListTenantEventsRequest) GetNext() *string { - if o == nil { +func (l *ListTenantEventsRequest) GetNext() *string { + if l == nil { return nil } - return o.Next + return l.Next } -func (o *ListTenantEventsRequest) GetPrev() *string { - if o == nil { +func (l *ListTenantEventsRequest) GetPrev() *string { + if l == nil { return nil } - return o.Prev + return l.Prev } -func (o *ListTenantEventsRequest) GetLimit() *int64 { - if o == nil { +func (l *ListTenantEventsRequest) GetLimit() *int64 { + if l == nil { return nil } - return o.Limit + return l.Limit } -func (o *ListTenantEventsRequest) GetStart() *time.Time { - if o == nil { +func (l *ListTenantEventsRequest) GetStart() *time.Time { + if l == nil { return nil } - return o.Start + return l.Start } -func (o *ListTenantEventsRequest) GetEnd() *time.Time { - if o == nil { +func (l *ListTenantEventsRequest) GetEnd() *time.Time { + if l == nil { return nil } - return o.End + return l.End } // ListTenantEventsResponseBody - A paginated list of events. @@ -205,37 +205,37 @@ type ListTenantEventsResponseBody struct { Count int64 `json:"count"` Data []components.Event `json:"data"` // Cursor for next page (empty string if no next page) - Next string `json:"next"` + NextCursor string `json:"next"` // Cursor for previous page (empty string if no previous page) - Prev string `json:"prev"` + PrevCursor string `json:"prev"` } -func (o *ListTenantEventsResponseBody) GetCount() int64 { - if o == nil { +func (l *ListTenantEventsResponseBody) GetCount() int64 { + if l == nil { return 0 } - return o.Count + return l.Count } -func (o *ListTenantEventsResponseBody) GetData() []components.Event { - if o == nil { +func (l *ListTenantEventsResponseBody) GetData() []components.Event { + if l == nil { return []components.Event{} } - return o.Data + return l.Data } -func (o *ListTenantEventsResponseBody) GetNext() string { - if o == nil { +func (l *ListTenantEventsResponseBody) GetNextCursor() string { + if l == nil { return "" } - return o.Next + return l.NextCursor } -func (o *ListTenantEventsResponseBody) GetPrev() string { - if o == nil { +func (l *ListTenantEventsResponseBody) GetPrevCursor() string { + if l == nil { return "" } - return o.Prev + return l.PrevCursor } type ListTenantEventsResponse struct { @@ -244,16 +244,16 @@ type ListTenantEventsResponse struct { Object *ListTenantEventsResponseBody } -func (o *ListTenantEventsResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTenantEventsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTenantEventsResponse) GetObject() *ListTenantEventsResponseBody { - if o == nil { +func (l *ListTenantEventsResponse) GetObject() *ListTenantEventsResponseBody { + if l == nil { return nil } - return o.Object + return l.Object } diff --git a/sdks/outpost-go/models/operations/listtenanteventsbydestination.go b/sdks/outpost-go/models/operations/listtenanteventsbydestination.go index 8eee31135..54748211b 100644 --- a/sdks/outpost-go/models/operations/listtenanteventsbydestination.go +++ b/sdks/outpost-go/models/operations/listtenanteventsbydestination.go @@ -14,11 +14,11 @@ type ListTenantEventsByDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantEventsByDestinationGlobals) GetTenantID() *string { - if o == nil { +func (l *ListTenantEventsByDestinationGlobals) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } // ListTenantEventsByDestinationStatus - Filter events by delivery status. @@ -72,66 +72,66 @@ func (l ListTenantEventsByDestinationRequest) MarshalJSON() ([]byte, error) { } func (l *ListTenantEventsByDestinationRequest) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &l, "", false, []string{"destination_id"}); err != nil { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { return err } return nil } -func (o *ListTenantEventsByDestinationRequest) GetTenantID() *string { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } -func (o *ListTenantEventsByDestinationRequest) GetDestinationID() string { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetDestinationID() string { + if l == nil { return "" } - return o.DestinationID + return l.DestinationID } -func (o *ListTenantEventsByDestinationRequest) GetStatus() *ListTenantEventsByDestinationStatus { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetStatus() *ListTenantEventsByDestinationStatus { + if l == nil { return nil } - return o.Status + return l.Status } -func (o *ListTenantEventsByDestinationRequest) GetNext() *string { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetNext() *string { + if l == nil { return nil } - return o.Next + return l.Next } -func (o *ListTenantEventsByDestinationRequest) GetPrev() *string { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetPrev() *string { + if l == nil { return nil } - return o.Prev + return l.Prev } -func (o *ListTenantEventsByDestinationRequest) GetLimit() *int64 { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetLimit() *int64 { + if l == nil { return nil } - return o.Limit + return l.Limit } -func (o *ListTenantEventsByDestinationRequest) GetStart() *time.Time { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetStart() *time.Time { + if l == nil { return nil } - return o.Start + return l.Start } -func (o *ListTenantEventsByDestinationRequest) GetEnd() *time.Time { - if o == nil { +func (l *ListTenantEventsByDestinationRequest) GetEnd() *time.Time { + if l == nil { return nil } - return o.End + return l.End } // ListTenantEventsByDestinationResponseBody - A paginated list of events for the destination. @@ -140,37 +140,37 @@ type ListTenantEventsByDestinationResponseBody struct { Count int64 `json:"count"` Data []components.Event `json:"data"` // Cursor for next page (empty string if no next page) - Next string `json:"next"` + NextCursor string `json:"next"` // Cursor for previous page (empty string if no previous page) - Prev string `json:"prev"` + PrevCursor string `json:"prev"` } -func (o *ListTenantEventsByDestinationResponseBody) GetCount() int64 { - if o == nil { +func (l *ListTenantEventsByDestinationResponseBody) GetCount() int64 { + if l == nil { return 0 } - return o.Count + return l.Count } -func (o *ListTenantEventsByDestinationResponseBody) GetData() []components.Event { - if o == nil { +func (l *ListTenantEventsByDestinationResponseBody) GetData() []components.Event { + if l == nil { return []components.Event{} } - return o.Data + return l.Data } -func (o *ListTenantEventsByDestinationResponseBody) GetNext() string { - if o == nil { +func (l *ListTenantEventsByDestinationResponseBody) GetNextCursor() string { + if l == nil { return "" } - return o.Next + return l.NextCursor } -func (o *ListTenantEventsByDestinationResponseBody) GetPrev() string { - if o == nil { +func (l *ListTenantEventsByDestinationResponseBody) GetPrevCursor() string { + if l == nil { return "" } - return o.Prev + return l.PrevCursor } type ListTenantEventsByDestinationResponse struct { @@ -179,16 +179,16 @@ type ListTenantEventsByDestinationResponse struct { Object *ListTenantEventsByDestinationResponseBody } -func (o *ListTenantEventsByDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTenantEventsByDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTenantEventsByDestinationResponse) GetObject() *ListTenantEventsByDestinationResponseBody { - if o == nil { +func (l *ListTenantEventsByDestinationResponse) GetObject() *ListTenantEventsByDestinationResponseBody { + if l == nil { return nil } - return o.Object + return l.Object } diff --git a/sdks/outpost-go/models/operations/listtenants.go b/sdks/outpost-go/models/operations/listtenants.go new file mode 100644 index 000000000..9bc74ddbe --- /dev/null +++ b/sdks/outpost-go/models/operations/listtenants.go @@ -0,0 +1,107 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/hookdeck/outpost/sdks/outpost-go/internal/utils" + "github.com/hookdeck/outpost/sdks/outpost-go/models/components" +) + +// Order - Sort order by `created_at` timestamp. +type Order string + +const ( + OrderAsc Order = "asc" + OrderDesc Order = "desc" +) + +func (e Order) ToPointer() *Order { + return &e +} +func (e *Order) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "asc": + fallthrough + case "desc": + *e = Order(v) + return nil + default: + return fmt.Errorf("invalid value for Order: %v", v) + } +} + +type ListTenantsRequest struct { + // Number of tenants to return per page (1-100, default 20). + Limit *int64 `default:"20" queryParam:"style=form,explode=true,name=limit"` + // Sort order by `created_at` timestamp. + Order *Order `default:"desc" queryParam:"style=form,explode=true,name=order"` + // Cursor for the next page of results. Mutually exclusive with `prev`. + Next *string `queryParam:"style=form,explode=true,name=next"` + // Cursor for the previous page of results. Mutually exclusive with `next`. + Prev *string `queryParam:"style=form,explode=true,name=prev"` +} + +func (l ListTenantsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListTenantsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, nil); err != nil { + return err + } + return nil +} + +func (l *ListTenantsRequest) GetLimit() *int64 { + if l == nil { + return nil + } + return l.Limit +} + +func (l *ListTenantsRequest) GetOrder() *Order { + if l == nil { + return nil + } + return l.Order +} + +func (l *ListTenantsRequest) GetNext() *string { + if l == nil { + return nil + } + return l.Next +} + +func (l *ListTenantsRequest) GetPrev() *string { + if l == nil { + return nil + } + return l.Prev +} + +type ListTenantsResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // List of tenants. + TenantListResponse *components.TenantListResponse +} + +func (l *ListTenantsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { + return components.HTTPMetadata{} + } + return l.HTTPMeta +} + +func (l *ListTenantsResponse) GetTenantListResponse() *components.TenantListResponse { + if l == nil { + return nil + } + return l.TenantListResponse +} diff --git a/sdks/outpost-go/models/operations/listtenanttopics.go b/sdks/outpost-go/models/operations/listtenanttopics.go index 16f8b4f9c..105b93347 100644 --- a/sdks/outpost-go/models/operations/listtenanttopics.go +++ b/sdks/outpost-go/models/operations/listtenanttopics.go @@ -10,11 +10,11 @@ type ListTenantTopicsGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantTopicsGlobals) GetTenantID() *string { - if o == nil { +func (l *ListTenantTopicsGlobals) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } type ListTenantTopicsRequest struct { @@ -22,11 +22,11 @@ type ListTenantTopicsRequest struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *ListTenantTopicsRequest) GetTenantID() *string { - if o == nil { +func (l *ListTenantTopicsRequest) GetTenantID() *string { + if l == nil { return nil } - return o.TenantID + return l.TenantID } type ListTenantTopicsResponse struct { @@ -35,16 +35,16 @@ type ListTenantTopicsResponse struct { Strings []string } -func (o *ListTenantTopicsResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTenantTopicsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTenantTopicsResponse) GetStrings() []string { - if o == nil { +func (l *ListTenantTopicsResponse) GetStrings() []string { + if l == nil { return nil } - return o.Strings + return l.Strings } diff --git a/sdks/outpost-go/models/operations/listtopics.go b/sdks/outpost-go/models/operations/listtopics.go index 32b1402c2..ba342db43 100644 --- a/sdks/outpost-go/models/operations/listtopics.go +++ b/sdks/outpost-go/models/operations/listtopics.go @@ -12,16 +12,16 @@ type ListTopicsResponse struct { Strings []string } -func (o *ListTopicsResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (l *ListTopicsResponse) GetHTTPMeta() components.HTTPMetadata { + if l == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return l.HTTPMeta } -func (o *ListTopicsResponse) GetStrings() []string { - if o == nil { +func (l *ListTopicsResponse) GetStrings() []string { + if l == nil { return nil } - return o.Strings + return l.Strings } diff --git a/sdks/outpost-go/models/operations/options.go b/sdks/outpost-go/models/operations/options.go index aa0176a6b..2725f3448 100644 --- a/sdks/outpost-go/models/operations/options.go +++ b/sdks/outpost-go/models/operations/options.go @@ -21,8 +21,8 @@ const ( type AcceptHeaderEnum string const ( - AcceptHeaderEnumTextPlain AcceptHeaderEnum = "text/plain" - AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" + AcceptHeaderEnumApplicationJson AcceptHeaderEnum = "application/json" + AcceptHeaderEnumWildcardRootWildcard AcceptHeaderEnum = "*/*" ) func (e AcceptHeaderEnum) ToPointer() *AcceptHeaderEnum { diff --git a/sdks/outpost-go/models/operations/publishevent.go b/sdks/outpost-go/models/operations/publishevent.go index 4d7dbfcd9..87bab2447 100644 --- a/sdks/outpost-go/models/operations/publishevent.go +++ b/sdks/outpost-go/models/operations/publishevent.go @@ -12,16 +12,16 @@ type PublishEventResponse struct { PublishResponse *components.PublishResponse } -func (o *PublishEventResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (p *PublishEventResponse) GetHTTPMeta() components.HTTPMetadata { + if p == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return p.HTTPMeta } -func (o *PublishEventResponse) GetPublishResponse() *components.PublishResponse { - if o == nil { +func (p *PublishEventResponse) GetPublishResponse() *components.PublishResponse { + if p == nil { return nil } - return o.PublishResponse + return p.PublishResponse } diff --git a/sdks/outpost-go/models/operations/retrytenantevent.go b/sdks/outpost-go/models/operations/retrytenantevent.go index 5807ccbcc..a693ac287 100644 --- a/sdks/outpost-go/models/operations/retrytenantevent.go +++ b/sdks/outpost-go/models/operations/retrytenantevent.go @@ -10,11 +10,11 @@ type RetryTenantEventGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *RetryTenantEventGlobals) GetTenantID() *string { - if o == nil { +func (r *RetryTenantEventGlobals) GetTenantID() *string { + if r == nil { return nil } - return o.TenantID + return r.TenantID } type RetryTenantEventRequest struct { @@ -26,34 +26,34 @@ type RetryTenantEventRequest struct { EventID string `pathParam:"style=simple,explode=false,name=event_id"` } -func (o *RetryTenantEventRequest) GetTenantID() *string { - if o == nil { +func (r *RetryTenantEventRequest) GetTenantID() *string { + if r == nil { return nil } - return o.TenantID + return r.TenantID } -func (o *RetryTenantEventRequest) GetDestinationID() string { - if o == nil { +func (r *RetryTenantEventRequest) GetDestinationID() string { + if r == nil { return "" } - return o.DestinationID + return r.DestinationID } -func (o *RetryTenantEventRequest) GetEventID() string { - if o == nil { +func (r *RetryTenantEventRequest) GetEventID() string { + if r == nil { return "" } - return o.EventID + return r.EventID } type RetryTenantEventResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` } -func (o *RetryTenantEventResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (r *RetryTenantEventResponse) GetHTTPMeta() components.HTTPMetadata { + if r == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return r.HTTPMeta } diff --git a/sdks/outpost-go/models/operations/updatetenantdestination.go b/sdks/outpost-go/models/operations/updatetenantdestination.go index df2bfb256..3e789faa0 100644 --- a/sdks/outpost-go/models/operations/updatetenantdestination.go +++ b/sdks/outpost-go/models/operations/updatetenantdestination.go @@ -13,40 +13,40 @@ type UpdateTenantDestinationGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *UpdateTenantDestinationGlobals) GetTenantID() *string { - if o == nil { +func (u *UpdateTenantDestinationGlobals) GetTenantID() *string { + if u == nil { return nil } - return o.TenantID + return u.TenantID } type UpdateTenantDestinationRequest struct { // The ID of the tenant. Required when using AdminApiKey authentication. TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` // The ID of the destination. - DestinationID string `pathParam:"style=simple,explode=false,name=destination_id"` - DestinationUpdate components.DestinationUpdate `request:"mediaType=application/json"` + DestinationID string `pathParam:"style=simple,explode=false,name=destination_id"` + Params components.DestinationUpdate `request:"mediaType=application/json"` } -func (o *UpdateTenantDestinationRequest) GetTenantID() *string { - if o == nil { +func (u *UpdateTenantDestinationRequest) GetTenantID() *string { + if u == nil { return nil } - return o.TenantID + return u.TenantID } -func (o *UpdateTenantDestinationRequest) GetDestinationID() string { - if o == nil { +func (u *UpdateTenantDestinationRequest) GetDestinationID() string { + if u == nil { return "" } - return o.DestinationID + return u.DestinationID } -func (o *UpdateTenantDestinationRequest) GetDestinationUpdate() components.DestinationUpdate { - if o == nil { +func (u *UpdateTenantDestinationRequest) GetParams() components.DestinationUpdate { + if u == nil { return components.DestinationUpdate{} } - return o.DestinationUpdate + return u.Params } type UpdateTenantDestinationResponseBodyType string @@ -57,7 +57,7 @@ const ( // UpdateTenantDestinationResponseBody - Destination updated successfully or OAuth redirect needed. type UpdateTenantDestinationResponseBody struct { - Destination *components.Destination `queryParam:"inline" name:"ResponseBody"` + Destination *components.Destination `queryParam:"inline" union:"member"` Type UpdateTenantDestinationResponseBodyType } @@ -97,16 +97,16 @@ type UpdateTenantDestinationResponse struct { OneOf *UpdateTenantDestinationResponseBody } -func (o *UpdateTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (u *UpdateTenantDestinationResponse) GetHTTPMeta() components.HTTPMetadata { + if u == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return u.HTTPMeta } -func (o *UpdateTenantDestinationResponse) GetOneOf() *UpdateTenantDestinationResponseBody { - if o == nil { +func (u *UpdateTenantDestinationResponse) GetOneOf() *UpdateTenantDestinationResponseBody { + if u == nil { return nil } - return o.OneOf + return u.OneOf } diff --git a/sdks/outpost-go/models/operations/upserttenant.go b/sdks/outpost-go/models/operations/upserttenant.go index 41d6b306d..99ed7da29 100644 --- a/sdks/outpost-go/models/operations/upserttenant.go +++ b/sdks/outpost-go/models/operations/upserttenant.go @@ -10,23 +10,32 @@ type UpsertTenantGlobals struct { TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` } -func (o *UpsertTenantGlobals) GetTenantID() *string { - if o == nil { +func (u *UpsertTenantGlobals) GetTenantID() *string { + if u == nil { return nil } - return o.TenantID + return u.TenantID } type UpsertTenantRequest struct { // The ID of the tenant. Required when using AdminApiKey authentication. TenantID *string `pathParam:"style=simple,explode=false,name=tenant_id"` + // Optional tenant metadata + Params *components.TenantUpsert `request:"mediaType=application/json"` } -func (o *UpsertTenantRequest) GetTenantID() *string { - if o == nil { +func (u *UpsertTenantRequest) GetTenantID() *string { + if u == nil { return nil } - return o.TenantID + return u.TenantID +} + +func (u *UpsertTenantRequest) GetParams() *components.TenantUpsert { + if u == nil { + return nil + } + return u.Params } type UpsertTenantResponse struct { @@ -35,16 +44,16 @@ type UpsertTenantResponse struct { Tenant *components.Tenant } -func (o *UpsertTenantResponse) GetHTTPMeta() components.HTTPMetadata { - if o == nil { +func (u *UpsertTenantResponse) GetHTTPMeta() components.HTTPMetadata { + if u == nil { return components.HTTPMetadata{} } - return o.HTTPMeta + return u.HTTPMeta } -func (o *UpsertTenantResponse) GetTenant() *components.Tenant { - if o == nil { +func (u *UpsertTenantResponse) GetTenant() *components.Tenant { + if u == nil { return nil } - return o.Tenant + return u.Tenant } diff --git a/sdks/outpost-go/optionalnullable/optionalnullable.go b/sdks/outpost-go/optionalnullable/optionalnullable.go new file mode 100644 index 000000000..c6739be06 --- /dev/null +++ b/sdks/outpost-go/optionalnullable/optionalnullable.go @@ -0,0 +1,233 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package optionalnullable + +import ( + "bytes" + "encoding/json" + "reflect" +) + +// OptionalNullable represents a field that can distinguish between three states: +// 1. Set to a value: field is present with a non-nil value +// 2. Set to nil: field is present but explicitly set to null in JSON +// 3. Unset: field is omitted from JSON entirely +// +// This type is designed to work with JSON marshaling/unmarshaling and supports +// the `omitempty` struct tag to properly omit unset fields from JSON output. +// +// Usage: +// +// type User struct { +// Name OptionalNullable[string] `json:"name,omitempty"` +// Age OptionalNullable[int] `json:"age,omitempty"` +// Tags OptionalNullable[[]string] `json:"tags,omitempty"` +// } +// +// // Set to value +// name := "John" +// user.Name = From(&name) +// +// // Set to nil (will appear as "name": null in JSON) +// user.Name = From[string](nil) +// +// // Leave unset (will be omitted from JSON with omitempty) +// user := User{} +// +// WARNING: Do NOT use *OptionalNullable[T] as a field type. Always use OptionalNullable[T] directly. +// Using *OptionalNullable[T] will break the omitempty behavior and JSON marshaling. +// +// The type is implemented as a map[bool]*T where: +// - nil map represents unset state +// - Map with true key represents set state (value may be nil) +type OptionalNullable[T any] map[bool]*T + +// From creates a new OptionalNullable with the given value. +// Pass nil to create a OptionalNullable that is set to null. +// Pass a pointer to a value to create a OptionalNullable with that value. +// +// Examples: +// +// hello := "hello" +// From(&hello) // set to "hello" +// From[string](nil) // set to null +func From[T any](value *T) OptionalNullable[T] { + return map[bool]*T{ + true: value, + } +} + +// IsNull returns true if the OptionalNullable is explicitly set to nil. +// Returns false if the OptionalNullable is unset or has a value. +// +// Note: This differs from traditional null checks because unset fields +// return false, not true. Use IsSet() to check if a field was provided. +func (n OptionalNullable[T]) IsNull() bool { + v, ok := n[true] + return ok && v == nil +} + +// IsSet returns true if the OptionalNullable has been explicitly set (to either a value or nil). +// Returns false if the OptionalNullable is unset (omitted from JSON). +// +// This is the key method for distinguishing between: +// - Set to nil: IsSet() = true, IsNull() = true +// - Unset: IsSet() = false, IsNull() = false +func (n OptionalNullable[T]) IsSet() bool { + _, ok := n[true] + return ok +} + +// Get returns the internal pointer and whether the field was set. +// +// Return values: +// - (ptr, true): field was set (ptr may be nil if set to null) +// - (nil, false): field was unset/omitted +// +// This method provides direct access to the internal pointer representation. +func (n OptionalNullable[T]) Get() (*T, bool) { + v, ok := n[true] + return v, ok +} + +// GetOrZero returns the value and whether it was set. +// +// Return values: +// - (value, true): field was set to a non-nil value +// - (zero, true): field was explicitly set to nil +// - (zero, false): field was unset/omitted +// +// Examples: +// +// val, ok := nullable.GetOrZero() +// if !ok { +// // Field was unset/omitted +// } else if nullable.IsNull() { +// // Field was explicitly set to null +// } else { +// // Field has a value: val +// } +func (n OptionalNullable[T]) GetOrZero() (T, bool) { + var zero T + + if v, ok := n[true]; ok { + if v == nil { + return zero, true + } + return *v, true + } + return zero, false +} + +// GetUntyped returns the value as interface{} and whether it was set. +// This is useful for reflection-based code that needs to work with the value +// without knowing the specific type T. +// +// Return values: +// - (value, true): field was set to a non-nil value +// - (nil, true): field was explicitly set to nil +// - (nil, false): field was unset/omitted +func (n OptionalNullable[T]) GetUntyped() (interface{}, bool) { + if v, ok := n[true]; ok { + if v == nil { + return nil, true + } + return *v, true + } + return nil, false +} + +// Set sets the OptionalNullable to the given value pointer. +// Pass nil to set the field to null. +// Pass a pointer to a value to set the field to that value. +// +// Examples: +// +// nullable.Set(ptrFrom("hello")) // set to "hello" +// nullable.Set(nil) // set to null +func (n *OptionalNullable[T]) Set(value *T) { + *n = map[bool]*T{ + true: value, + } +} + +// Unset removes the value, making the field unset/omitted. +// After calling Unset(), IsSet() will return false and the field +// will be omitted from JSON output when using omitempty. +func (n *OptionalNullable[T]) Unset() { + *n = map[bool]*T{} +} + +// MarshalJSON implements json.Marshaler. +// +// Behavior: +// - Unset fields: omitted from JSON when struct field has omitempty tag +// - Null fields: serialized as "null" +// - Value fields: serialized as the actual value +// +// The omitempty behavior works because an empty map is considered +// a zero value by Go's JSON package. +func (n OptionalNullable[T]) MarshalJSON() ([]byte, error) { + if n.IsNull() { + return []byte("null"), nil + } + + return json.Marshal(n[true]) +} + +// UnmarshalJSON implements json.Unmarshaler. +// +// Behavior: +// - "null" in JSON: sets the field to null (IsSet=true, IsNull=true) +// - Any other value: sets the field to that value (IsSet=true, IsNull=false) +// - Missing from JSON: field remains unset (IsSet=false, IsNull=false) +func (n *OptionalNullable[T]) UnmarshalJSON(data []byte) error { + if bytes.Equal(data, []byte("null")) { + n.Set(nil) + return nil + } + var v T + if err := json.Unmarshal(data, &v); err != nil { + return err + } + n.Set(&v) + return nil +} + +// NullableInterface defines the interface that all OptionalNullable[T] types implement. +// This interface provides untyped access to optional nullable values for reflection-based code. +type OptionalNullableInterface interface { + GetUntyped() (interface{}, bool) +} + +// AsOptionalNullable attempts to convert a reflect.Value to a OptionalNullableInterface. +// This is a helper function for reflection-based code that needs to check +// if a value implements the optional nullable interface pattern. +// +// Returns: +// - (nullable, true): if the value implements OptionalNullableInterface +// - (nil, false): if the value does not implement OptionalNullableInterface +// +// Example usage: +// +// if nullable, ok := AsOptionalNullable(reflectValue); ok { +// if value, isSet := nullable.GetUntyped(); isSet { +// // Handle the nullable value +// } +// } +func AsOptionalNullable(v reflect.Value) (OptionalNullableInterface, bool) { + // Check if the value can be converted to an interface first + if !v.CanInterface() { + return nil, false + } + + // Check if the underlying value is a nil map (unset nullable) + if v.Kind() == reflect.Map && v.IsNil() { + return nil, false + } + + if nullable, ok := v.Interface().(OptionalNullableInterface); ok { + return nullable, true + } + return nil, false +} diff --git a/sdks/outpost-go/optionalnullable/optionalnullable_test.go b/sdks/outpost-go/optionalnullable/optionalnullable_test.go new file mode 100644 index 000000000..e6e5a01c6 --- /dev/null +++ b/sdks/outpost-go/optionalnullable/optionalnullable_test.go @@ -0,0 +1,1806 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package optionalnullable + +import ( + "encoding/json" + "reflect" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// Test helper function to create pointers from values +func ptrFrom[T any](value T) *T { + return &value +} + +// Test helper types for comprehensive testing +type TestStruct struct { + Name string `json:"name"` + Age int `json:"age"` +} + +type TestContainer struct { + StringField OptionalNullable[string] `json:"string_field,omitempty"` + IntField OptionalNullable[int] `json:"int_field,omitempty"` + SliceField OptionalNullable[[]string] `json:"slice_field,omitempty"` + StructField OptionalNullable[TestStruct] `json:"struct_field,omitempty"` +} + +// TestNewNullable tests the From constructor +func TestNewNullable(t *testing.T) { + t.Parallel() + t.Run("with string value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "test", got) + }) + + t.Run("with nil pointer", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "", got) // zero value for string + }) + + t.Run("with int value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom(42)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 42, got) + }) + + t.Run("with slice value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom([]string{"a", "b", "c"})) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b", "c"}, got) + }) + + t.Run("with empty slice", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom([]string{})) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{}, got) + }) + + t.Run("with struct value", func(t *testing.T) { + t.Parallel() + val := TestStruct{Name: "John", Age: 30} + nullable := From(&val) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + v, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, val, v) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, TestStruct{Name: "John", Age: 30}, got) + }) +} + +// TestNewNullableUnset tests the NewNullableUnset constructor +func TestNewNullableUnset(t *testing.T) { + t.Parallel() + t.Run("string type", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // Unset is not null + + got, ok := nullable.GetOrZero() + assert.False(t, ok) + assert.Equal(t, "", got) // zero value for string + }) + + t.Run("int type", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[int] + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // Unset is not null + + got, ok := nullable.GetOrZero() + assert.False(t, ok) + assert.Equal(t, 0, got) // zero value for int + }) + + t.Run("slice type", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[[]string] + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // Unset is not null + + got, ok := nullable.GetOrZero() + assert.False(t, ok) + assert.Nil(t, got) // zero value for slice is nil + }) +} + +// TestIsNull tests the IsNull method +func TestIsNull(t *testing.T) { + t.Parallel() + t.Run("with value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + assert.False(t, nullable.IsNull()) + }) + + t.Run("with nil pointer", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + assert.True(t, nullable.IsNull()) + }) + + t.Run("unset", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + assert.False(t, nullable.IsNull()) + }) +} + +// TestIsSet tests the IsSet method +func TestIsSet(t *testing.T) { + t.Parallel() + t.Run("with value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + assert.True(t, nullable.IsSet()) + }) + + t.Run("with nil pointer", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + assert.True(t, nullable.IsSet()) + }) + + t.Run("unset", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + assert.False(t, nullable.IsSet()) + }) +} + +// TestGet tests the Get method +func TestGet(t *testing.T) { + t.Parallel() + t.Run("with string value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "test", got) + }) + + t.Run("with nil pointer", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "", got) // zero value + }) + + t.Run("unset", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + + got, ok := nullable.GetOrZero() + assert.False(t, ok) + assert.Equal(t, "", got) // zero value + }) + + t.Run("with slice value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom([]string{"a", "b"})) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b"}, got) + }) + + t.Run("with nil slice pointer", func(t *testing.T) { + t.Parallel() + nullable := From[[]string](nil) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Nil(t, got) // zero value for slice is nil + }) +} + +// TestPointer tests the Pointer method +func TestPointer(t *testing.T) { + t.Parallel() + t.Run("with value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + + ptr, ok := nullable.Get() + assert.True(t, ok) + assert.NotNil(t, ptr) + assert.Equal(t, "test", *ptr) + }) + + t.Run("with nil pointer", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + + ptr, ok := nullable.Get() + assert.True(t, ok) + assert.Nil(t, ptr) + }) + + t.Run("unset", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + + ptr, ok := nullable.Get() + assert.False(t, ok) + assert.Nil(t, ptr) + }) +} + +// TestSet tests the Set method +func TestSet(t *testing.T) { + t.Parallel() + t.Run("set string value", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + + // Initially unset + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // Unset is not null + + // Set a value + nullable.Set(ptrFrom("test")) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "test", got) + }) + + t.Run("set int value", func(t *testing.T) { + t.Parallel() + nullable := OptionalNullable[int]{} + + nullable.Set(ptrFrom(42)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 42, got) + }) + + t.Run("set slice value", func(t *testing.T) { + t.Parallel() + nullable := OptionalNullable[[]string]{} + + slice := []string{"a", "b"} + nullable.Set(ptrFrom(slice)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b"}, got) + }) + + t.Run("set empty slice", func(t *testing.T) { + t.Parallel() + nullable := OptionalNullable[[]string]{} + + slice := []string{} + nullable.Set(ptrFrom(slice)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{}, got) + }) + + t.Run("overwrite existing value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("original")) + + // Verify original value + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "original", got) + + // Set new value + nullable.Set(ptrFrom("new")) + + got, ok = nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "new", got) + }) +} + +// TestUnset tests the Unset method +func TestUnset(t *testing.T) { + t.Parallel() + t.Run("unset from value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + + // Initially set + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + // Unset + nullable.Unset() + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // After unset is not null + // Value is now internal to the map implementation + + got, ok := nullable.GetOrZero() + assert.False(t, ok) + assert.Equal(t, "", got) // zero value + }) + + t.Run("unset from nil", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + + // Initially set to nil + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) // Set to nil should be null + + // Unset + nullable.Unset() + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // After unset is not null + }) + + t.Run("unset already unset", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + + // Initially unset + assert.False(t, nullable.IsSet()) + + // Unset again + nullable.Unset() + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) // Empty map is not null + }) +} + +// TestMarshalJSON tests JSON marshaling +func TestMarshalJSON(t *testing.T) { + t.Parallel() + t.Run("marshal string value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `"test"`, string(data)) + }) + + t.Run("marshal int value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom(42)) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `42`, string(data)) + }) + + t.Run("marshal nil value", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `null`, string(data)) + }) + + t.Run("marshal slice value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom([]string{"a", "b", "c"})) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `["a","b","c"]`, string(data)) + }) + + t.Run("marshal empty slice", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom([]string{})) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `[]`, string(data)) + }) + + t.Run("marshal struct value", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom(TestStruct{Name: "John", Age: 30})) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `{"name":"John","age":30}`, string(data)) + }) + + // Note: Unset values are not tested here because the current implementation + // doesn't handle unset fields in marshaling (see TODO in the code) +} + +// TestUnmarshalJSON tests JSON unmarshaling +func TestUnmarshalJSON(t *testing.T) { + t.Parallel() + t.Run("unmarshal string value", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + err := json.Unmarshal([]byte(`"test"`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "test", got) + }) + + t.Run("unmarshal int value", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[int] + err := json.Unmarshal([]byte(`42`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 42, got) + }) + + t.Run("unmarshal null value", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + err := json.Unmarshal([]byte(`null`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "", got) // zero value + }) + + t.Run("unmarshal slice value", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[[]string] + err := json.Unmarshal([]byte(`["a","b","c"]`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b", "c"}, got) + }) + + t.Run("unmarshal empty slice", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[[]string] + err := json.Unmarshal([]byte(`[]`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{}, got) + }) + + t.Run("unmarshal struct value", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[TestStruct] + err := json.Unmarshal([]byte(`{"name":"John","age":30}`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, TestStruct{Name: "John", Age: 30}, got) + }) + + t.Run("unmarshal invalid JSON", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + err := json.Unmarshal([]byte(`invalid`), &nullable) + assert.Error(t, err) + + // Ensure the nullable remains unset after error + assert.False(t, nullable.IsSet()) + }) + + t.Run("unmarshal invalid JSON for int", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[int] + err := json.Unmarshal([]byte(`"not_a_number"`), &nullable) + assert.Error(t, err) + + // Ensure the nullable remains unset after error + assert.False(t, nullable.IsSet()) + }) + + t.Run("unmarshal malformed JSON", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[TestStruct] + err := json.Unmarshal([]byte(`{invalid json`), &nullable) + assert.Error(t, err) + + // Ensure the nullable remains unset after error + assert.False(t, nullable.IsSet()) + }) +} + +// TestJSONRoundTrip tests marshaling and unmarshaling together +func TestJSONRoundTrip(t *testing.T) { + t.Parallel() + t.Run("string value round trip", func(t *testing.T) { + t.Parallel() + nullable1 := From(ptrFrom("test value")) + + // Marshal + data, err := json.Marshal(nullable1) + require.NoError(t, err) + + // Unmarshal + var nullable2 OptionalNullable[string] + err = json.Unmarshal(data, &nullable2) + require.NoError(t, err) + + // Compare + assert.Equal(t, nullable1.IsSet(), nullable2.IsSet()) + assert.Equal(t, nullable1.IsNull(), nullable2.IsNull()) + + got1, ok1 := nullable1.GetOrZero() + got2, ok2 := nullable2.GetOrZero() + assert.Equal(t, ok1, ok2) + assert.Equal(t, got1, got2) + }) + + t.Run("nil value round trip", func(t *testing.T) { + t.Parallel() + nullable1 := From[string](nil) + + // Marshal + data, err := json.Marshal(nullable1) + require.NoError(t, err) + + // Unmarshal + var nullable2 OptionalNullable[string] + err = json.Unmarshal(data, &nullable2) + require.NoError(t, err) + + // Compare + assert.Equal(t, nullable1.IsSet(), nullable2.IsSet()) + assert.Equal(t, nullable1.IsNull(), nullable2.IsNull()) + + got1, ok1 := nullable1.GetOrZero() + got2, ok2 := nullable2.GetOrZero() + assert.Equal(t, ok1, ok2) + assert.Equal(t, got1, got2) + }) + + t.Run("slice round trip", func(t *testing.T) { + t.Parallel() + nullable1 := From(ptrFrom([]string{"a", "b", "c"})) + + // Marshal + data, err := json.Marshal(nullable1) + require.NoError(t, err) + + // Unmarshal + var nullable2 OptionalNullable[[]string] + err = json.Unmarshal(data, &nullable2) + require.NoError(t, err) + + // Compare + assert.Equal(t, nullable1.IsSet(), nullable2.IsSet()) + assert.Equal(t, nullable1.IsNull(), nullable2.IsNull()) + + got1, ok1 := nullable1.GetOrZero() + got2, ok2 := nullable2.GetOrZero() + assert.Equal(t, ok1, ok2) + assert.Equal(t, got1, got2) + }) +} + +// TestJSONToJSONRoundTrip tests starting with JSON and ensuring we can serialize back to the same JSON +func TestJSONToJSONRoundTrip(t *testing.T) { + t.Parallel() + t.Run("string value JSON round trip", func(t *testing.T) { + t.Parallel() + originalJSON := `"hello world"` + + // Unmarshal from JSON + var nullable OptionalNullable[string] + err := json.Unmarshal([]byte(originalJSON), &nullable) + require.NoError(t, err) + + // Verify state + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "hello world", got) + + // Marshal back to JSON + resultJSON, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, originalJSON, string(resultJSON)) + }) + + t.Run("null value JSON round trip", func(t *testing.T) { + t.Parallel() + originalJSON := `null` + + // Unmarshal from JSON + var nullable OptionalNullable[string] + err := json.Unmarshal([]byte(originalJSON), &nullable) + require.NoError(t, err) + + // Verify state + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "", got) // zero value + + // Marshal back to JSON + resultJSON, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, originalJSON, string(resultJSON)) + }) + + t.Run("int value JSON round trip", func(t *testing.T) { + t.Parallel() + originalJSON := `42` + + // Unmarshal from JSON + var nullable OptionalNullable[int] + err := json.Unmarshal([]byte(originalJSON), &nullable) + require.NoError(t, err) + + // Verify state + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 42, got) + + // Marshal back to JSON + resultJSON, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, originalJSON, string(resultJSON)) + }) + + t.Run("slice value JSON round trip", func(t *testing.T) { + t.Parallel() + originalJSON := `["a","b","c"]` + + // Unmarshal from JSON + var nullable OptionalNullable[[]string] + err := json.Unmarshal([]byte(originalJSON), &nullable) + require.NoError(t, err) + + // Verify state + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b", "c"}, got) + + // Marshal back to JSON + resultJSON, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, originalJSON, string(resultJSON)) + }) + + t.Run("empty slice JSON round trip", func(t *testing.T) { + t.Parallel() + originalJSON := `[]` + + // Unmarshal from JSON + var nullable OptionalNullable[[]string] + err := json.Unmarshal([]byte(originalJSON), &nullable) + require.NoError(t, err) + + // Verify state + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{}, got) + + // Marshal back to JSON + resultJSON, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, originalJSON, string(resultJSON)) + }) + + t.Run("struct value JSON round trip", func(t *testing.T) { + t.Parallel() + originalJSON := `{"name":"Alice","age":25}` + + // Unmarshal from JSON + var nullable OptionalNullable[TestStruct] + err := json.Unmarshal([]byte(originalJSON), &nullable) + require.NoError(t, err) + + // Verify state + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, TestStruct{Name: "Alice", Age: 25}, got) + + // Marshal back to JSON + resultJSON, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, originalJSON, string(resultJSON)) + }) +} + +// TestContainerStates tests comprehensive state detection and serialization with TestContainer +func TestContainerStates(t *testing.T) { + t.Parallel() + t.Run("all fields set to values", func(t *testing.T) { + t.Parallel() + container := TestContainer{ + StringField: From(ptrFrom("hello")), + IntField: From(ptrFrom(42)), + SliceField: From(ptrFrom([]string{"a", "b"})), + StructField: From(ptrFrom(TestStruct{Name: "John", Age: 30})), + } + + // Verify all fields are set and not null + assert.True(t, container.StringField.IsSet()) + assert.False(t, container.StringField.IsNull()) + assert.True(t, container.IntField.IsSet()) + assert.False(t, container.IntField.IsNull()) + assert.True(t, container.SliceField.IsSet()) + assert.False(t, container.SliceField.IsNull()) + assert.True(t, container.StructField.IsSet()) + assert.False(t, container.StructField.IsNull()) + + // Verify values + stringVal, ok := container.StringField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "hello", stringVal) + + intVal, ok := container.IntField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 42, intVal) + + sliceVal, ok := container.SliceField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b"}, sliceVal) + + structVal, ok := container.StructField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, TestStruct{Name: "John", Age: 30}, structVal) + + // Test JSON serialization + data, err := json.Marshal(container) + require.NoError(t, err) + + var result map[string]interface{} + err = json.Unmarshal(data, &result) + require.NoError(t, err) + + assert.Equal(t, "hello", result["string_field"]) + assert.Equal(t, float64(42), result["int_field"]) // JSON numbers are float64 + assert.Equal(t, []interface{}{"a", "b"}, result["slice_field"]) + structResult := result["struct_field"].(map[string]interface{}) + assert.Equal(t, "John", structResult["name"]) + assert.Equal(t, float64(30), structResult["age"]) + }) + + t.Run("all fields set to nil", func(t *testing.T) { + t.Parallel() + container := TestContainer{ + StringField: From[string](nil), + IntField: From[int](nil), + SliceField: From[[]string](nil), + StructField: From[TestStruct](nil), + } + + // Verify all fields are set but null + assert.True(t, container.StringField.IsSet()) + assert.True(t, container.StringField.IsNull()) + assert.True(t, container.IntField.IsSet()) + assert.True(t, container.IntField.IsNull()) + assert.True(t, container.SliceField.IsSet()) + assert.True(t, container.SliceField.IsNull()) + assert.True(t, container.StructField.IsSet()) + assert.True(t, container.StructField.IsNull()) + + // Verify GetOrZero() behavior for nil values + stringVal, ok := container.StringField.GetOrZero() + assert.True(t, ok) // set to nil still returns true + assert.Equal(t, "", stringVal) // zero value + + intVal, ok := container.IntField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 0, intVal) // zero value + + sliceVal, ok := container.SliceField.GetOrZero() + assert.True(t, ok) + assert.Nil(t, sliceVal) // zero value for slice is nil + + structVal, ok := container.StructField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, TestStruct{}, structVal) // zero value + + // Test JSON serialization - all should be null + data, err := json.Marshal(container) + require.NoError(t, err) + + var result map[string]interface{} + err = json.Unmarshal(data, &result) + require.NoError(t, err) + + assert.Nil(t, result["string_field"]) + assert.Nil(t, result["int_field"]) + assert.Nil(t, result["slice_field"]) + assert.Nil(t, result["struct_field"]) + }) + + t.Run("all fields unset", func(t *testing.T) { + t.Parallel() + container := TestContainer{} + + // Verify all fields are unset + assert.False(t, container.StringField.IsSet()) + assert.False(t, container.StringField.IsNull()) // unset is not null in new implementation + assert.False(t, container.IntField.IsSet()) + assert.False(t, container.IntField.IsNull()) + assert.False(t, container.SliceField.IsSet()) + assert.False(t, container.SliceField.IsNull()) + assert.False(t, container.StructField.IsSet()) + assert.False(t, container.StructField.IsNull()) + + // Verify GetOrZero() behavior for unset values + stringVal, ok := container.StringField.GetOrZero() + assert.False(t, ok) // unset returns false + assert.Equal(t, "", stringVal) // zero value + + intVal, ok := container.IntField.GetOrZero() + assert.False(t, ok) + assert.Equal(t, 0, intVal) // zero value + + sliceVal, ok := container.SliceField.GetOrZero() + assert.False(t, ok) + assert.Nil(t, sliceVal) // zero value + + structVal, ok := container.StructField.GetOrZero() + assert.False(t, ok) + assert.Equal(t, TestStruct{}, structVal) // zero value + + // Test JSON serialization - unset fields should be omitted due to omitempty + data, err := json.Marshal(container) + require.NoError(t, err) + + var result map[string]interface{} + err = json.Unmarshal(data, &result) + require.NoError(t, err) + + // With omitempty, unset fields should not appear in JSON + assert.NotContains(t, result, "string_field") + assert.NotContains(t, result, "int_field") + assert.NotContains(t, result, "slice_field") + assert.NotContains(t, result, "struct_field") + }) + + t.Run("slice field states: nil vs unset vs empty vs set", func(t *testing.T) { + t.Parallel() + // Test all possible slice states + nilSlice := TestContainer{ + SliceField: From[[]string](nil), // explicitly set to nil + } + unsetSlice := TestContainer{} // unset + emptySlice := TestContainer{ + SliceField: From(ptrFrom([]string{})), // empty slice + } + setSlice := TestContainer{ + SliceField: From(ptrFrom([]string{"a", "b"})), // slice with values + } + + // Verify nil slice + assert.True(t, nilSlice.SliceField.IsSet()) + assert.True(t, nilSlice.SliceField.IsNull()) + val, ok := nilSlice.SliceField.GetOrZero() + assert.True(t, ok) + assert.Nil(t, val) + + // Verify unset slice + assert.False(t, unsetSlice.SliceField.IsSet()) + assert.False(t, unsetSlice.SliceField.IsNull()) // Unset is not null + val, ok = unsetSlice.SliceField.GetOrZero() + assert.False(t, ok) + assert.Nil(t, val) + + // Verify empty slice + assert.True(t, emptySlice.SliceField.IsSet()) + assert.False(t, emptySlice.SliceField.IsNull()) + val, ok = emptySlice.SliceField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{}, val) + + // Verify set slice + assert.True(t, setSlice.SliceField.IsSet()) + assert.False(t, setSlice.SliceField.IsNull()) + val, ok = setSlice.SliceField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, []string{"a", "b"}, val) + + // Test JSON serialization for each state + nilData, err := json.Marshal(nilSlice) + require.NoError(t, err) + assert.Contains(t, string(nilData), `"slice_field":null`) + + unsetData, err := json.Marshal(unsetSlice) + require.NoError(t, err) + assert.NotContains(t, string(unsetData), "slice_field") // omitted due to omitempty + + emptyData, err := json.Marshal(emptySlice) + require.NoError(t, err) + assert.Contains(t, string(emptyData), `"slice_field":[]`) + + setData, err := json.Marshal(setSlice) + require.NoError(t, err) + assert.Contains(t, string(setData), `"slice_field":["a","b"]`) + }) + + t.Run("mixed states container", func(t *testing.T) { + t.Parallel() + container := TestContainer{ + StringField: From(ptrFrom("hello")), // set to value + IntField: From[int](nil), // set to nil + StructField: From(ptrFrom(TestStruct{Name: "Alice", Age: 25})), // set to value + } + + // Verify states + assert.True(t, container.StringField.IsSet()) + assert.False(t, container.StringField.IsNull()) + + assert.True(t, container.IntField.IsSet()) + assert.True(t, container.IntField.IsNull()) + + assert.False(t, container.SliceField.IsSet()) + assert.False(t, container.SliceField.IsNull()) // Unset is not null + + assert.True(t, container.StructField.IsSet()) + assert.False(t, container.StructField.IsNull()) + + // Test JSON serialization + data, err := json.Marshal(container) + require.NoError(t, err) + + var result map[string]interface{} + err = json.Unmarshal(data, &result) + require.NoError(t, err) + + assert.Equal(t, "hello", result["string_field"]) + assert.Nil(t, result["int_field"]) + assert.NotContains(t, result, "slice_field") // unset, so omitted + structResult := result["struct_field"].(map[string]interface{}) + assert.Equal(t, "Alice", structResult["name"]) + assert.Equal(t, float64(25), structResult["age"]) + }) + + t.Run("JSON unmarshaling preserves states", func(t *testing.T) { + t.Parallel() + // JSON with some fields missing, some null, some with values + jsonData := `{ + "string_field": "test", + "int_field": null, + "struct_field": {"name": "Bob", "age": 35} + }` + + var container TestContainer + err := json.Unmarshal([]byte(jsonData), &container) + require.NoError(t, err) + + // string_field: present with value + assert.True(t, container.StringField.IsSet()) + assert.False(t, container.StringField.IsNull()) + stringVal, ok := container.StringField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "test", stringVal) + + // int_field: present but null + assert.True(t, container.IntField.IsSet()) + assert.True(t, container.IntField.IsNull()) + intVal, ok := container.IntField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 0, intVal) // zero value + + // slice_field: missing from JSON, should remain unset + assert.False(t, container.SliceField.IsSet()) + assert.False(t, container.SliceField.IsNull()) // Unset is not null + sliceVal, ok := container.SliceField.GetOrZero() + assert.False(t, ok) + assert.Nil(t, sliceVal) + + // struct_field: present with value + assert.True(t, container.StructField.IsSet()) + assert.False(t, container.StructField.IsNull()) + structVal, ok := container.StructField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, TestStruct{Name: "Bob", Age: 35}, structVal) + }) +} + +// TestNilVsUnsetDistinction tests the key feature of distinguishing nil from unset +func TestNilVsUnsetDistinction(t *testing.T) { + t.Parallel() + t.Run("explicit nil vs unset", func(t *testing.T) { + t.Parallel() + // Explicitly set to nil + explicitNil := From[string](nil) + + // Unset + var unset OptionalNullable[string] + + // Both are null, but only one is set + assert.True(t, explicitNil.IsNull()) + assert.True(t, explicitNil.IsSet()) + + assert.False(t, unset.IsNull()) // Unset is not null + assert.False(t, unset.IsSet()) + + // Get behavior differs + got1, ok1 := explicitNil.GetOrZero() + got2, ok2 := unset.GetOrZero() + + assert.True(t, ok1) // explicitly set to nil returns true + assert.False(t, ok2) // unset returns false + assert.Equal(t, "", got1) // both return zero value + assert.Equal(t, "", got2) + + // Get behavior differs + ptr1, ok1 := explicitNil.Get() + ptr2, ok2 := unset.Get() + + assert.True(t, ok1) // explicitly set to nil returns true + assert.False(t, ok2) // unset returns false + assert.Nil(t, ptr1) // both return nil pointer + assert.Nil(t, ptr2) + }) + + t.Run("empty slice vs nil slice vs unset", func(t *testing.T) { + t.Parallel() + // Empty slice + emptyNullable := From(ptrFrom([]string{})) + + // Nil slice + nilNullable := From[[]string](nil) + + // Unset + var unsetNullable OptionalNullable[[]string] + + // All have different characteristics + assert.True(t, emptyNullable.IsSet()) + assert.False(t, emptyNullable.IsNull()) + + assert.True(t, nilNullable.IsSet()) + assert.True(t, nilNullable.IsNull()) + + assert.False(t, unsetNullable.IsSet()) + assert.False(t, unsetNullable.IsNull()) // Unset is not null + + // Get behavior + got1, ok1 := emptyNullable.GetOrZero() + got2, ok2 := nilNullable.GetOrZero() + got3, ok3 := unsetNullable.GetOrZero() + + assert.True(t, ok1) + assert.Equal(t, []string{}, got1) + + assert.True(t, ok2) + assert.Nil(t, got2) + + assert.False(t, ok3) + assert.Nil(t, got3) + }) +} + +// TestJSONOmitEmpty tests behavior with omitempty tag +func TestJSONOmitEmpty(t *testing.T) { + t.Parallel() + t.Run("marshal with omitempty", func(t *testing.T) { + t.Parallel() + // Test container with various nullable states + container := TestContainer{ + StringField: From(ptrFrom("test")), + IntField: From(ptrFrom(42)), + StructField: From[TestStruct](nil), // explicitly nil + } + + data, err := json.Marshal(container) + require.NoError(t, err) + + // Parse back to verify structure + var result map[string]interface{} + err = json.Unmarshal(data, &result) + require.NoError(t, err) + + // Should contain set fields + assert.Contains(t, result, "string_field") + assert.Contains(t, result, "int_field") + assert.Contains(t, result, "struct_field") + + // Should not contain unset field (due to omitempty) + // Note: This depends on how the marshaling handles unset fields + // The current implementation doesn't handle this case properly (see TODO) + }) + + t.Run("unmarshal missing fields", func(t *testing.T) { + t.Parallel() + // JSON with some fields missing + jsonData := `{"string_field": "test", "int_field": null}` + + var container TestContainer + err := json.Unmarshal([]byte(jsonData), &container) + require.NoError(t, err) + + // Present fields should be set + assert.True(t, container.StringField.IsSet()) + assert.False(t, container.StringField.IsNull()) + got, ok := container.StringField.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "test", got) + + // Null field should be set to nil + assert.True(t, container.IntField.IsSet()) + assert.True(t, container.IntField.IsNull()) + + // Missing fields should remain unset + assert.False(t, container.SliceField.IsSet()) + assert.False(t, container.StructField.IsSet()) + }) +} + +// TestEdgeCases tests various edge cases +func TestEdgeCases(t *testing.T) { + t.Parallel() + t.Run("zero values", func(t *testing.T) { + t.Parallel() + // Test with zero values that are not nil + intNullable := From(ptrFrom(0)) + stringNullable := From(ptrFrom("")) + + assert.True(t, intNullable.IsSet()) + assert.False(t, intNullable.IsNull()) + got, ok := intNullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, 0, got) + + assert.True(t, stringNullable.IsSet()) + assert.False(t, stringNullable.IsNull()) + got2, ok2 := stringNullable.GetOrZero() + assert.True(t, ok2) + assert.Equal(t, "", got2) + }) + + t.Run("pointer to pointer", func(t *testing.T) { + t.Parallel() + // Test with pointer to pointer type + inner := "test" + nullable := From(ptrFrom(&inner)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, &inner, got) + assert.Equal(t, "test", *got) + }) + + t.Run("complex struct", func(t *testing.T) { + t.Parallel() + complexStruct := struct { + Name string + Values []int + Metadata map[string]string + }{ + Name: "complex", + Values: []int{1, 2, 3}, + Metadata: map[string]string{ + "key1": "value1", + "key2": "value2", + }, + } + + nullable := From(ptrFrom(complexStruct)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, complexStruct, got) + }) +} + +// TestDoublePointers tests comprehensive double pointer scenarios +func TestDoublePointers(t *testing.T) { + t.Parallel() + + t.Run("string double pointer with value", func(t *testing.T) { + t.Parallel() + inner := "hello world" + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Equal(t, &inner, got) + assert.Equal(t, "hello world", *got) + }) + + t.Run("int double pointer with value", func(t *testing.T) { + t.Parallel() + inner := 42 + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Equal(t, &inner, got) + assert.Equal(t, 42, *got) + }) + + t.Run("double pointer to nil", func(t *testing.T) { + t.Parallel() + var ptr *string = nil + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Nil(t, got) + }) + + t.Run("nil double pointer", func(t *testing.T) { + t.Parallel() + nullable := From[*string](nil) + + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Nil(t, got) // zero value for **string is nil + }) + + t.Run("unset double pointer", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[*string] + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.False(t, ok) + assert.Nil(t, got) // zero value for **string is nil + }) + + t.Run("double pointer modification", func(t *testing.T) { + t.Parallel() + inner := "original" + ptr := &inner + nullable := From(ptrFrom(ptr)) + + // Verify original value + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "original", *got) + + // Modify through double pointer + *got = "modified" + assert.Equal(t, "modified", inner) + assert.Equal(t, "modified", *got) + }) + + t.Run("double pointer to struct", func(t *testing.T) { + t.Parallel() + inner := TestStruct{Name: "Alice", Age: 30} + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Equal(t, TestStruct{Name: "Alice", Age: 30}, *got) + + // Modify through double pointer + (*got).Name = "Bob" + assert.Equal(t, "Bob", inner.Name) + assert.Equal(t, "Bob", (*got).Name) + }) + + t.Run("double pointer to slice", func(t *testing.T) { + t.Parallel() + inner := []string{"a", "b", "c"} + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Equal(t, []string{"a", "b", "c"}, *got) + + // Modify through double pointer + *got = append(*got, "d") + assert.Equal(t, []string{"a", "b", "c", "d"}, inner) + assert.Equal(t, []string{"a", "b", "c", "d"}, *got) + }) + + t.Run("double pointer to empty slice", func(t *testing.T) { + t.Parallel() + inner := []string{} + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Equal(t, []string{}, *got) + }) + + t.Run("double pointer to nil slice", func(t *testing.T) { + t.Parallel() + var inner []string = nil + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr, got) + assert.Nil(t, *got) + }) + + t.Run("double pointer JSON marshaling", func(t *testing.T) { + t.Parallel() + inner := "json test" + ptr := &inner + nullable := From(ptrFrom(ptr)) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `"json test"`, string(data)) + }) + + t.Run("double pointer JSON unmarshaling", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[*string] + err := json.Unmarshal([]byte(`"json test"`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.NotNil(t, got) + assert.Equal(t, "json test", *got) + }) + + t.Run("double pointer JSON null marshaling", func(t *testing.T) { + t.Parallel() + nullable := From[*string](nil) + + data, err := json.Marshal(nullable) + require.NoError(t, err) + assert.Equal(t, `null`, string(data)) + }) + + t.Run("double pointer JSON null unmarshaling", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[*string] + err := json.Unmarshal([]byte(`null`), &nullable) + require.NoError(t, err) + + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Nil(t, got) + }) + + t.Run("double pointer round trip", func(t *testing.T) { + t.Parallel() + inner := "round trip test" + ptr := &inner + nullable1 := From(ptrFrom(ptr)) + + // Marshal + data, err := json.Marshal(nullable1) + require.NoError(t, err) + + // Unmarshal + var nullable2 OptionalNullable[*string] + err = json.Unmarshal(data, &nullable2) + require.NoError(t, err) + + // Compare states + assert.Equal(t, nullable1.IsSet(), nullable2.IsSet()) + assert.Equal(t, nullable1.IsNull(), nullable2.IsNull()) + + got1, ok1 := nullable1.GetOrZero() + got2, ok2 := nullable2.GetOrZero() + assert.Equal(t, ok1, ok2) + + // Values should be equal + assert.Equal(t, *got1, *got2) + }) + + t.Run("triple pointer", func(t *testing.T) { + t.Parallel() + inner := "triple" + ptr1 := &inner + ptr2 := &ptr1 + nullable := From(ptrFrom(ptr2)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, ptr2, got) + assert.Equal(t, ptr1, *got) + assert.Equal(t, "triple", **got) + }) + + t.Run("double pointer set and unset", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[*string] + + // Initially unset + assert.False(t, nullable.IsSet()) + + // Set to double pointer + inner := "set test" + ptr := &inner + nullable.Set(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "set test", *got) + + // Set to nil + nullable.Set(nil) + + assert.True(t, nullable.IsSet()) + assert.True(t, nullable.IsNull()) + + got, ok = nullable.GetOrZero() + assert.True(t, ok) + assert.Nil(t, got) + + // Unset + nullable.Unset() + + assert.False(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok = nullable.GetOrZero() + assert.False(t, ok) + assert.Nil(t, got) + }) + + t.Run("double pointer Get method", func(t *testing.T) { + t.Parallel() + inner := "get test" + ptr := &inner + nullable := From(ptrFrom(ptr)) + + // Test Get method + gotPtr, ok := nullable.Get() + assert.True(t, ok) + assert.NotNil(t, gotPtr) + assert.Equal(t, ptr, *gotPtr) + assert.Equal(t, "get test", **gotPtr) + + // Test with nil + nilNullable := From[*string](nil) + gotPtr, ok = nilNullable.Get() + assert.True(t, ok) + assert.Nil(t, gotPtr) + + // Test with unset + var unsetNullable OptionalNullable[*string] + gotPtr, ok = unsetNullable.Get() + assert.False(t, ok) + assert.Nil(t, gotPtr) + }) + + t.Run("double pointer zero values", func(t *testing.T) { + t.Parallel() + // Test with zero value string + inner := "" + ptr := &inner + nullable := From(ptrFrom(ptr)) + + assert.True(t, nullable.IsSet()) + assert.False(t, nullable.IsNull()) + + got, ok := nullable.GetOrZero() + assert.True(t, ok) + assert.Equal(t, "", *got) + + // Test with zero value int + innerInt := 0 + ptrInt := &innerInt + nullableInt := From(ptrFrom(ptrInt)) + + assert.True(t, nullableInt.IsSet()) + assert.False(t, nullableInt.IsNull()) + + gotInt, okInt := nullableInt.GetOrZero() + assert.True(t, okInt) + assert.Equal(t, 0, *gotInt) + }) +} + +// TestAsOptionalNullable tests the AsOptionalNullable helper function +func TestAsOptionalNullable(t *testing.T) { + t.Parallel() + + t.Run("with nullable string", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, "test", value) + }) + + t.Run("with nullable int", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom(42)) + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, 42, value) + }) + + t.Run("with nullable nil", func(t *testing.T) { + t.Parallel() + nullable := From[string](nil) + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Nil(t, value) + }) + + t.Run("with unset nullable", func(t *testing.T) { + t.Parallel() + var nullable OptionalNullable[string] + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.False(t, ok) + assert.Nil(t, result) + }) + + t.Run("with non-nullable string", func(t *testing.T) { + t.Parallel() + regularString := "not nullable" + reflectValue := reflect.ValueOf(regularString) + + result, ok := AsOptionalNullable(reflectValue) + assert.False(t, ok) + assert.Nil(t, result) + }) + + t.Run("with non-nullable int", func(t *testing.T) { + t.Parallel() + regularInt := 42 + reflectValue := reflect.ValueOf(regularInt) + + result, ok := AsOptionalNullable(reflectValue) + assert.False(t, ok) + assert.Nil(t, result) + }) + + t.Run("with non-nullable map", func(t *testing.T) { + t.Parallel() + regularMap := map[string]int{"key": 42} + reflectValue := reflect.ValueOf(regularMap) + + result, ok := AsOptionalNullable(reflectValue) + assert.False(t, ok) + assert.Nil(t, result) + }) + + t.Run("with non-nullable struct", func(t *testing.T) { + t.Parallel() + regularStruct := TestStruct{Name: "test", Age: 30} + reflectValue := reflect.ValueOf(regularStruct) + + result, ok := AsOptionalNullable(reflectValue) + assert.False(t, ok) + assert.Nil(t, result) + }) + + t.Run("with nullable double pointer", func(t *testing.T) { + t.Parallel() + inner := "test" + ptr := &inner + nullable := From(ptrFrom(ptr)) + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, ptr, value) + assert.Equal(t, "test", *value.(*string)) + }) + + t.Run("with nullable slice", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom([]string{"a", "b", "c"})) + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, []string{"a", "b", "c"}, value) + }) + + t.Run("with nullable struct", func(t *testing.T) { + t.Parallel() + testStruct := TestStruct{Name: "Alice", Age: 25} + nullable := From(ptrFrom(testStruct)) + reflectValue := reflect.ValueOf(nullable) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, testStruct, value) + }) + + t.Run("with pointer to nullable", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + ptrToNullable := &nullable + reflectValue := reflect.ValueOf(ptrToNullable) + + // This should work since the pointer to nullable still contains a nullable + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, "test", value) + }) + + t.Run("with interface containing nullable", func(t *testing.T) { + t.Parallel() + nullable := From(ptrFrom("test")) + var iface interface{} = nullable + reflectValue := reflect.ValueOf(iface) + + result, ok := AsOptionalNullable(reflectValue) + assert.True(t, ok) + assert.NotNil(t, result) + + value, isSet := result.GetUntyped() + assert.True(t, isSet) + assert.Equal(t, "test", value) + }) +} diff --git a/sdks/outpost-go/outpost.go b/sdks/outpost-go/outpost.go index e0ab043fe..8ebcbb64f 100644 --- a/sdks/outpost-go/outpost.go +++ b/sdks/outpost-go/outpost.go @@ -2,7 +2,7 @@ package outpostgo -// Generated from OpenAPI doc version 0.0.1 and generator version 2.691.6 +// Generated from OpenAPI doc version 0.0.1 and generator version 2.796.1 import ( "context" @@ -174,9 +174,9 @@ func WithTimeout(timeout time.Duration) SDKOption { // New creates a new instance of the SDK with the provided options func New(opts ...SDKOption) *Outpost { sdk := &Outpost{ - SDKVersion: "0.4.0", + SDKVersion: "0.5.0", sdkConfiguration: config.SDKConfiguration{ - UserAgent: "speakeasy-sdk/go 0.4.0 2.691.6 0.0.1 github.com/hookdeck/outpost/sdks/outpost-go", + UserAgent: "speakeasy-sdk/go 0.5.0 2.796.1 0.0.1 github.com/hookdeck/outpost/sdks/outpost-go", Globals: globals.Globals{}, ServerList: ServerList, }, diff --git a/sdks/outpost-go/publish.go b/sdks/outpost-go/publish.go index bc617231c..1078c29c9 100644 --- a/sdks/outpost-go/publish.go +++ b/sdks/outpost-go/publish.go @@ -64,7 +64,7 @@ func (s *Publish) Event(ctx context.Context, request components.PublishRequest, BaseURL: baseURL, Context: ctx, OperationID: "publishEvent", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) diff --git a/sdks/outpost-go/schemas.go b/sdks/outpost-go/schemas.go index 444a0d206..46854eeb8 100644 --- a/sdks/outpost-go/schemas.go +++ b/sdks/outpost-go/schemas.go @@ -61,7 +61,7 @@ func (s *Schemas) ListTenantDestinationTypes(ctx context.Context, tenantID *stri } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destination-types", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destination-types", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -72,7 +72,7 @@ func (s *Schemas) ListTenantDestinationTypes(ctx context.Context, tenantID *stri BaseURL: baseURL, Context: ctx, OperationID: "listTenantDestinationTypeSchemas", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -178,7 +178,7 @@ func (s *Schemas) ListTenantDestinationTypes(ctx context.Context, tenantID *stri _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -222,221 +222,6 @@ func (s *Schemas) ListTenantDestinationTypes(ctx context.Context, tenantID *stri } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -493,7 +278,7 @@ func (s *Schemas) Get(ctx context.Context, type_ operations.GetTenantDestination } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/destination-types/{type}", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/destination-types/{type}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -504,7 +289,7 @@ func (s *Schemas) Get(ctx context.Context, type_ operations.GetTenantDestination BaseURL: baseURL, Context: ctx, OperationID: "getTenantDestinationTypeSchema", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -610,7 +395,7 @@ func (s *Schemas) Get(ctx context.Context, type_ operations.GetTenantDestination _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -654,221 +439,6 @@ func (s *Schemas) Get(ctx context.Context, type_ operations.GetTenantDestination } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -927,7 +497,7 @@ func (s *Schemas) ListDestinationTypesJwt(ctx context.Context, opts ...operation BaseURL: baseURL, Context: ctx, OperationID: "listDestinationTypeSchemasJwt", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1373,7 +943,7 @@ func (s *Schemas) GetDestinationTypeJwt(ctx context.Context, type_ operations.Ge BaseURL: baseURL, Context: ctx, OperationID: "getDestinationTypeSchema", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } diff --git a/sdks/outpost-go/tenants.go b/sdks/outpost-go/tenants.go index 5afdd5924..c1e500333 100644 --- a/sdks/outpost-go/tenants.go +++ b/sdks/outpost-go/tenants.go @@ -14,6 +14,7 @@ import ( "github.com/hookdeck/outpost/sdks/outpost-go/models/operations" "github.com/hookdeck/outpost/sdks/outpost-go/retry" "net/http" + "net/url" ) // Tenants - The API segments resources per `tenant`. A tenant represents a user/team/organization in your product. The provided value determines the tenant's ID, which can be any string representation. @@ -33,15 +34,20 @@ func newTenants(rootSDK *Outpost, sdkConfig config.SDKConfiguration, hooks *hook } } -// Upsert - Create or Update Tenant -// Idempotently creates or updates a tenant. Required before associating destinations. -func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.UpsertTenantResponse, error) { - request := operations.UpsertTenantRequest{ - TenantID: tenantID, - } - - globals := operations.UpsertTenantGlobals{ - TenantID: s.sdkConfiguration.Globals.TenantID, +// ListTenants - List Tenants +// List all tenants with cursor-based pagination. +// +// **Requirements:** This endpoint requires Redis with RediSearch module (e.g., `redis/redis-stack-server`). +// If RediSearch is not available, this endpoint returns `501 Not Implemented`. +// +// The response includes lightweight tenant objects without computed fields like `destinations_count` and `topics`. +// Use `GET /tenants/{tenant_id}` to retrieve full tenant details including these fields. +func (s *Tenants) ListTenants(ctx context.Context, limit *int64, order *operations.Order, next *string, prev *string, opts ...operations.Option) (*operations.ListTenantsResponse, error) { + request := operations.ListTenantsRequest{ + Limit: limit, + Order: order, + Next: next, + Prev: prev, } o := operations.Options{} @@ -62,7 +68,7 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}", request, globals) + opURL, err := url.JoinPath(baseURL, "/tenants") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -72,8 +78,8 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "upsertTenant", - OAuth2Scopes: []string{}, + OperationID: "listTenants", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -88,13 +94,17 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio defer cancel() } - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, nil, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -179,7 +189,7 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "401", "4XX", "501", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -194,7 +204,7 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio } } - res := &operations.UpsertTenantResponse{ + res := &operations.ListTenantsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -203,96 +213,6 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio switch { case httpRes.StatusCode == 200: - fallthrough - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out components.Tenant - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Tenant = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -300,12 +220,12 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio return nil, err } - var out apierrors.RateLimitedError + var out components.TenantListResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.TenantListResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -314,16 +234,6 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -331,32 +241,15 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio return nil, err } - var out apierrors.BadRequestError + var out apierrors.ListTenantsBadRequestError if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, } - return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -366,60 +259,6 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -427,32 +266,15 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio return nil, err } - var out apierrors.BadRequestError + var out apierrors.NotImplementedError if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + out.HTTPMeta = components.HTTPMetadata{ + Request: req, + Response: httpRes, } - return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -461,6 +283,8 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } + case httpRes.StatusCode == 401: + fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -485,14 +309,15 @@ func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operatio } -// Get Tenant -// Retrieves details for a specific tenant. -func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.GetTenantResponse, error) { - request := operations.GetTenantRequest{ +// Upsert - Create or Update Tenant +// Idempotently creates or updates a tenant. Required before associating destinations. +func (s *Tenants) Upsert(ctx context.Context, tenantID *string, params *components.TenantUpsert, opts ...operations.Option) (*operations.UpsertTenantResponse, error) { + request := operations.UpsertTenantRequest{ TenantID: tenantID, + Params: params, } - globals := operations.GetTenantGlobals{ + globals := operations.UpsertTenantGlobals{ TenantID: s.sdkConfiguration.Globals.TenantID, } @@ -514,7 +339,7 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -524,10 +349,14 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. SDKConfiguration: s.sdkConfiguration, BaseURL: baseURL, Context: ctx, - OperationID: "getTenant", - OAuth2Scopes: []string{}, + OperationID: "upsertTenant", + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "Params", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } timeout := o.Timeout if timeout == nil { @@ -540,12 +369,15 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. defer cancel() } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if reqContentType != "" { + req.Header.Set("Content-Type", reqContentType) + } if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -631,7 +463,7 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -646,7 +478,7 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. } } - res := &operations.GetTenantResponse{ + res := &operations.UpsertTenantResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -655,6 +487,8 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. switch { case httpRes.StatusCode == 200: + fallthrough + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -675,201 +509,200 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, apierrors.NewAPIError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + return res, nil - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } +} - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } +// Get Tenant +// Retrieves details for a specific tenant. +func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.GetTenantResponse, error) { + request := operations.GetTenantRequest{ + TenantID: tenantID, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + globals := operations.GetTenantGlobals{ + TenantID: s.sdkConfiguration.Globals.TenantID, + } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + o := operations.Options{} + supportedOptions := []string{ + operations.SupportedOptionRetries, + operations.SupportedOptionTimeout, + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + for _, opt := range opts { + if err := opt(&o, supportedOptions...); err != nil { + return nil, fmt.Errorf("error applying option: %w", err) } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}", request, globals) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + hookCtx := hooks.HookContext{ + SDK: s.rootSDK, + SDKConfiguration: s.sdkConfiguration, + BaseURL: baseURL, + Context: ctx, + OperationID: "getTenant", + OAuth2Scopes: nil, + SecuritySource: s.sdkConfiguration.Security, + } + + timeout := o.Timeout + if timeout == nil { + timeout = s.sdkConfiguration.Timeout + } + + if timeout != nil { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, *timeout) + defer cancel() + } + + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + for k, v := range o.SetHeaders { + req.Header.Set(k, v) + } + + globalRetryConfig := s.sdkConfiguration.RetryConfig + retryConfig := o.Retries + if retryConfig == nil { + if globalRetryConfig != nil { + retryConfig = globalRetryConfig } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } + } - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } + var httpRes *http.Response + if retryConfig != nil { + httpRes, err = utils.Retry(ctx, utils.Retries{ + Config: retryConfig, + StatusCodes: []string{ + "429", + "500", + "502", + "503", + "504", + }, + }, func() (*http.Response, error) { + if req.Body != nil && req.Body != http.NoBody && req.GetBody != nil { + copyBody, err := req.GetBody() - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err + if err != nil { + return nil, err + } + + req.Body = copyBody } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) if err != nil { - return nil, err + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) } - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) } + return httpRes, err + }) - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { if err != nil { - return nil, err + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.GetTenantResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -877,12 +710,12 @@ func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations. return nil, err } - var out apierrors.UnauthorizedError + var out components.Tenant if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.Tenant = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -945,7 +778,7 @@ func (s *Tenants) Delete(ctx context.Context, tenantID *string, opts ...operatio } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -956,7 +789,7 @@ func (s *Tenants) Delete(ctx context.Context, tenantID *string, opts ...operatio BaseURL: baseURL, Context: ctx, OperationID: "deleteTenant", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1062,7 +895,7 @@ func (s *Tenants) Delete(ctx context.Context, tenantID *string, opts ...operatio _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1106,222 +939,7 @@ func (s *Tenants) Delete(ctx context.Context, tenantID *string, opts ...operatio } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 404: + case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1377,7 +995,7 @@ func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *ope } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/portal", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/portal", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1388,7 +1006,7 @@ func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *ope BaseURL: baseURL, Context: ctx, OperationID: "getTenantPortalUrl", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1410,7 +1028,7 @@ func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *ope req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, globals); err != nil { + if err := utils.PopulateQueryParams(ctx, req, request, globals, nil); err != nil { return nil, fmt.Errorf("error populating query params: %w", err) } @@ -1454,289 +1072,74 @@ func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *ope req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) if err != nil { - if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { - return nil, err - } - - return nil, retry.Permanent(err) - } - - httpRes, err := s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - } - return httpRes, err - }) - - if err != nil { - return nil, err - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } else { - req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) - if err != nil { - return nil, err - } - - httpRes, err = s.sdkConfiguration.Client.Do(req) - if err != nil || httpRes == nil { - if err != nil { - err = fmt.Errorf("error sending request: %w", err) - } else { - err = fmt.Errorf("error sending request: no response") - } - - _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) - return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { - _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) - if err != nil { - return nil, err - } else if _httpRes != nil { - httpRes = _httpRes - } - } else { - httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) - if err != nil { - return nil, err - } - } - } - - res := &operations.GetTenantPortalURLResponse{ - HTTPMeta: components.HTTPMetadata{ - Request: req, - Response: httpRes, - }, - } - - switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out components.PortalRedirect - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.PortalRedirect = &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err + if retry.IsPermanentError(err) || retry.IsTemporaryError(err) { + return nil, err + } + + return nil, retry.Permanent(err) } - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err + httpRes, err := s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { + if err != nil { + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") + } + + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) } + return httpRes, err + }) - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + req, err = s.hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, err + } + + httpRes, err = s.sdkConfiguration.Client.Do(req) + if err != nil || httpRes == nil { if err != nil { - return nil, err + err = fmt.Errorf("error sending request: %w", err) + } else { + err = fmt.Errorf("error sending request: no response") } - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { return nil, err + } else if _httpRes != nil { + httpRes = _httpRes } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) + } else { + httpRes, err = s.hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) if err != nil { return nil, err } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 511: + } + + res := &operations.GetTenantPortalURLResponse{ + HTTPMeta: components.HTTPMetadata{ + Request: req, + Response: httpRes, + }, + } + + switch { + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): rawBody, err := utils.ConsumeRawBody(httpRes) @@ -1744,12 +1147,12 @@ func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *ope return nil, err } - var out apierrors.UnauthorizedError + var out components.PortalRedirect if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - return nil, &out + res.PortalRedirect = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { @@ -1812,7 +1215,7 @@ func (s *Tenants) GetToken(ctx context.Context, tenantID *string, opts ...operat } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/token", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/token", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1823,7 +1226,7 @@ func (s *Tenants) GetToken(ctx context.Context, tenantID *string, opts ...operat BaseURL: baseURL, Context: ctx, OperationID: "getTenantToken", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -1929,7 +1332,7 @@ func (s *Tenants) GetToken(ctx context.Context, tenantID *string, opts ...operat _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -1973,221 +1376,6 @@ func (s *Tenants) GetToken(ctx context.Context, tenantID *string, opts ...operat } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: diff --git a/sdks/outpost-go/topics.go b/sdks/outpost-go/topics.go index 4c2641b24..361710ab6 100644 --- a/sdks/outpost-go/topics.go +++ b/sdks/outpost-go/topics.go @@ -61,7 +61,7 @@ func (s *Topics) List(ctx context.Context, tenantID *string, opts ...operations. } else { baseURL = *o.ServerURL } - opURL, err := utils.GenerateURL(ctx, baseURL, "/{tenant_id}/topics", request, globals) + opURL, err := utils.GenerateURL(ctx, baseURL, "/tenants/{tenant_id}/topics", request, globals) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -72,7 +72,7 @@ func (s *Topics) List(ctx context.Context, tenantID *string, opts ...operations. BaseURL: baseURL, Context: ctx, OperationID: "listTenantTopics", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } @@ -178,7 +178,7 @@ func (s *Topics) List(ctx context.Context, tenantID *string, opts ...operations. _, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "401", "403", "404", "407", "408", "413", "414", "415", "422", "429", "431", "4XX", "500", "501", "502", "503", "504", "505", "506", "507", "508", "510", "511", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -222,221 +222,6 @@ func (s *Topics) List(ctx context.Context, tenantID *string, opts ...operations. } return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } - case httpRes.StatusCode == 401: - fallthrough - case httpRes.StatusCode == 403: - fallthrough - case httpRes.StatusCode == 407: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 408: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 429: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.RateLimitedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 400: - fallthrough - case httpRes.StatusCode == 413: - fallthrough - case httpRes.StatusCode == 414: - fallthrough - case httpRes.StatusCode == 415: - fallthrough - case httpRes.StatusCode == 422: - fallthrough - case httpRes.StatusCode == 431: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 504: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.TimeoutError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 501: - fallthrough - case httpRes.StatusCode == 505: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.NotFoundError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 500: - fallthrough - case httpRes.StatusCode == 502: - fallthrough - case httpRes.StatusCode == 503: - fallthrough - case httpRes.StatusCode == 506: - fallthrough - case httpRes.StatusCode == 507: - fallthrough - case httpRes.StatusCode == 508: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.InternalServerError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 510: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.BadRequestError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 511: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - - var out apierrors.UnauthorizedError - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - return nil, &out - default: - rawBody, err := utils.ConsumeRawBody(httpRes) - if err != nil { - return nil, err - } - return nil, apierrors.NewAPIError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } case httpRes.StatusCode == 404: fallthrough case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: @@ -495,7 +280,7 @@ func (s *Topics) ListJwt(ctx context.Context, opts ...operations.Option) (*opera BaseURL: baseURL, Context: ctx, OperationID: "listTopics", - OAuth2Scopes: []string{}, + OAuth2Scopes: nil, SecuritySource: s.sdkConfiguration.Security, } diff --git a/sdks/outpost-go/types/decimal.go b/sdks/outpost-go/types/decimal.go deleted file mode 100644 index d8429bc6b..000000000 --- a/sdks/outpost-go/types/decimal.go +++ /dev/null @@ -1,20 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package types - -import ( - "fmt" - - "github.com/ericlagergren/decimal" -) - -// MustNewDecimalFromString returns an instance of Decimal from a string -// Avoid using this function in production code. -func MustNewDecimalFromString(s string) *decimal.Big { - d, ok := new(decimal.Big).SetString(s) - if !ok { - panic(fmt.Errorf("failed to parse string as decimal.Big")) - } - - return d -}