diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0d859ee..973ded1 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,17 +1,17 @@ lockVersion: 2.0.0 id: b81e5def-5b1e-4753-ae7c-0efccc2e6f61 management: - docChecksum: e9093ae35a5e8939c715167d4836f51a + docChecksum: 621f79fe092199d80a95ca5aa0238ebc docVersion: 0.0.1 - speakeasyVersion: 1.428.0 - generationVersion: 2.447.4 - releaseVersion: 0.1.5 - configChecksum: 842844ce7940b9fa7ce8ff52e625d2fe + speakeasyVersion: 1.439.0 + generationVersion: 2.457.9 + releaseVersion: 0.1.6 + configChecksum: 5464a3ce17d764c785662a6628d0b0ec features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.6 - core: 3.5.15 + core: 3.5.16 deepObjectParams: 0.1.0 defaultEnabledRetries: 0.2.0 envVarSecurityUsage: 0.3.2 @@ -61,7 +61,7 @@ generatedFiles: - /models/components/cursorpaginatedmetawithsizeandtotal.go - /models/components/dataplaneclientcertificate.go - /models/components/dataplaneclientcertificaterequest.go - - /models/components/getexpectedconfighash.go + - /models/components/getexpectedconfighashresponse.go - /models/components/getimpersonationsettingsresponse.go - /models/components/getnode.go - /models/components/groupconflict.go @@ -74,6 +74,7 @@ generatedFiles: - /models/components/idp.go - /models/components/invalidparameterchoiceitem.go - /models/components/invalidparameterdependentitem.go + - /models/components/invalidparametermaximumlength.go - /models/components/invalidparameterminimumlength.go - /models/components/invalidparameters.go - /models/components/invalidparameterstandard.go @@ -94,6 +95,8 @@ generatedFiles: - /models/components/listnodeseol.go - /models/components/listpluginschemas.go - /models/components/meorganization.go + - /models/components/mtlsauth.go + - /models/components/mtlsauthwithoutparents.go - /models/components/pagemeta.go - /models/components/paginatedmeta.go - /models/components/patchteamgroupmappings.go @@ -143,6 +146,7 @@ generatedFiles: - /models/components/vault.go - /models/components/vaultinput.go - /models/operations/addconsumertogroup.go + - /models/operations/addconsumertospecificconsumergroup.go - /models/operations/addusertoteam.go - /models/operations/authenticatesso.go - /models/operations/createaclwithconsumer.go @@ -159,8 +163,11 @@ generatedFiles: - /models/operations/createkeyauthwithconsumer.go - /models/operations/createkeyset.go - /models/operations/createkeywithkeyset.go + - /models/operations/createmtlsauthwithconsumer.go - /models/operations/createplugin.go - /models/operations/createpluginschemas.go + - /models/operations/createpluginwithconsumer.go + - /models/operations/createpluginwithconsumergroup.go - /models/operations/createpluginwithroute.go - /models/operations/createpluginwithservice.go - /models/operations/createroute.go @@ -186,9 +193,12 @@ generatedFiles: - /models/operations/deletekeyauthwithconsumer.go - /models/operations/deletekeyset.go - /models/operations/deletekeywithkeyset.go + - /models/operations/deletemtlsauthwithconsumer.go - /models/operations/deletenodesnodeid.go - /models/operations/deleteplugin.go - /models/operations/deletepluginschemas.go + - /models/operations/deletepluginwithconsumer.go + - /models/operations/deletepluginwithconsumergroup.go - /models/operations/deletepluginwithroute.go - /models/operations/deletepluginwithservice.go - /models/operations/deleteroute.go @@ -228,11 +238,14 @@ generatedFiles: - /models/operations/getkeyauthwithconsumer.go - /models/operations/getkeyset.go - /models/operations/getkeywithkeyset.go + - /models/operations/getmtlsauthwithconsumer.go - /models/operations/getnodeseol.go - /models/operations/getnodesnodeid.go - /models/operations/getorganizationsme.go - /models/operations/getplugin.go - /models/operations/getpluginschema.go + - /models/operations/getpluginwithconsumer.go + - /models/operations/getpluginwithconsumergroup.go - /models/operations/getpluginwithroute.go - /models/operations/getpluginwithservice.go - /models/operations/getpredefinedroles.go @@ -265,6 +278,7 @@ generatedFiles: - /models/operations/listconsumer.go - /models/operations/listconsumergroup.go - /models/operations/listconsumergroupsforconsumer.go + - /models/operations/listconsumersforconsumergroup.go - /models/operations/listcontrolplanes.go - /models/operations/listdataplanenodes.go - /models/operations/listdpclientcertificates.go @@ -277,8 +291,12 @@ generatedFiles: - /models/operations/listkeyauthwithconsumer.go - /models/operations/listkeyset.go - /models/operations/listkeywithkeyset.go + - /models/operations/listmtlsauth.go + - /models/operations/listmtlsauthwithconsumer.go - /models/operations/listplugin.go - /models/operations/listpluginschemas.go + - /models/operations/listpluginwithconsumer.go + - /models/operations/listpluginwithconsumergroup.go - /models/operations/listpluginwithroute.go - /models/operations/listpluginwithservice.go - /models/operations/listroute.go @@ -305,6 +323,7 @@ generatedFiles: - /models/operations/postsystemaccountsidaccesstokens.go - /models/operations/postteamsteamidsystemaccounts.go - /models/operations/putcontrolplanesidgroupmemberships.go + - /models/operations/removeconsumerfromconsumergroup.go - /models/operations/removeconsumerfromgroup.go - /models/operations/removeuserfromteam.go - /models/operations/teamsassignrole.go @@ -329,7 +348,10 @@ generatedFiles: - /models/operations/upsertkeyauthwithconsumer.go - /models/operations/upsertkeyset.go - /models/operations/upsertkeywithkeyset.go + - /models/operations/upsertmtlsauthwithconsumer.go - /models/operations/upsertplugin.go + - /models/operations/upsertpluginwithconsumer.go + - /models/operations/upsertpluginwithconsumergroup.go - /models/operations/upsertpluginwithroute.go - /models/operations/upsertpluginwithservice.go - /models/operations/upsertroute.go @@ -427,7 +449,7 @@ generatedFiles: - docs/models/components/entityregion.md - docs/models/components/entitytypename.md - docs/models/components/gatewayserviceadmin.md - - docs/models/components/getexpectedconfighash.md + - docs/models/components/getexpectedconfighashresponse.md - docs/models/components/getimpersonationsettingsresponse.md - docs/models/components/getnode.md - docs/models/components/getnodecompatibilitystatus.md @@ -452,6 +474,8 @@ generatedFiles: - docs/models/components/invalidparameterchoiceitemrule.md - docs/models/components/invalidparameterdependentitem.md - docs/models/components/invalidparameterdependentitemrule.md + - docs/models/components/invalidparametermaximumlength.md + - docs/models/components/invalidparametermaximumlengthrule.md - docs/models/components/invalidparameterminimumlength.md - docs/models/components/invalidparameters.md - docs/models/components/invalidparameterstandard.md @@ -491,6 +515,11 @@ generatedFiles: - docs/models/components/meorganizationstate.md - docs/models/components/meshcontrolplanes.md - docs/models/components/meta.md + - docs/models/components/mtlsauth.md + - docs/models/components/mtlsauthcacertificate.md + - docs/models/components/mtlsauthconsumer.md + - docs/models/components/mtlsauthwithoutparents.md + - docs/models/components/mtlsauthwithoutparentscacertificate.md - docs/models/components/name.md - docs/models/components/one.md - docs/models/components/ordering.md @@ -664,6 +693,10 @@ generatedFiles: - docs/models/operations/addconsumertogrouprequestbody.md - docs/models/operations/addconsumertogroupresponse.md - docs/models/operations/addconsumertogroupresponsebody.md + - docs/models/operations/addconsumertospecificconsumergrouprequest.md + - docs/models/operations/addconsumertospecificconsumergrouprequestbody.md + - docs/models/operations/addconsumertospecificconsumergroupresponse.md + - docs/models/operations/addconsumertospecificconsumergroupresponsebody.md - docs/models/operations/addusertoteamrequest.md - docs/models/operations/addusertoteamresponse.md - docs/models/operations/authenticatessorequest.md @@ -695,10 +728,16 @@ generatedFiles: - docs/models/operations/createkeysetresponse.md - docs/models/operations/createkeywithkeysetrequest.md - docs/models/operations/createkeywithkeysetresponse.md + - docs/models/operations/createmtlsauthwithconsumerrequest.md + - docs/models/operations/createmtlsauthwithconsumerresponse.md - docs/models/operations/createpluginrequest.md - docs/models/operations/createpluginresponse.md - docs/models/operations/createpluginschemasrequest.md - docs/models/operations/createpluginschemasresponse.md + - docs/models/operations/createpluginwithconsumergrouprequest.md + - docs/models/operations/createpluginwithconsumergroupresponse.md + - docs/models/operations/createpluginwithconsumerrequest.md + - docs/models/operations/createpluginwithconsumerresponse.md - docs/models/operations/createpluginwithrouterequest.md - docs/models/operations/createpluginwithrouteresponse.md - docs/models/operations/createpluginwithservicerequest.md @@ -748,12 +787,18 @@ generatedFiles: - docs/models/operations/deletekeysetresponse.md - docs/models/operations/deletekeywithkeysetrequest.md - docs/models/operations/deletekeywithkeysetresponse.md + - docs/models/operations/deletemtlsauthwithconsumerrequest.md + - docs/models/operations/deletemtlsauthwithconsumerresponse.md - docs/models/operations/deletenodesnodeidrequest.md - docs/models/operations/deletenodesnodeidresponse.md - docs/models/operations/deletepluginrequest.md - docs/models/operations/deletepluginresponse.md - docs/models/operations/deletepluginschemasrequest.md - docs/models/operations/deletepluginschemasresponse.md + - docs/models/operations/deletepluginwithconsumergrouprequest.md + - docs/models/operations/deletepluginwithconsumergroupresponse.md + - docs/models/operations/deletepluginwithconsumerrequest.md + - docs/models/operations/deletepluginwithconsumerresponse.md - docs/models/operations/deletepluginwithrouterequest.md - docs/models/operations/deletepluginwithrouteresponse.md - docs/models/operations/deletepluginwithservicerequest.md @@ -831,6 +876,8 @@ generatedFiles: - docs/models/operations/getkeysetresponse.md - docs/models/operations/getkeywithkeysetrequest.md - docs/models/operations/getkeywithkeysetresponse.md + - docs/models/operations/getmtlsauthwithconsumerrequest.md + - docs/models/operations/getmtlsauthwithconsumerresponse.md - docs/models/operations/getnodeseolrequest.md - docs/models/operations/getnodeseolresponse.md - docs/models/operations/getnodesnodeidrequest.md @@ -840,6 +887,10 @@ generatedFiles: - docs/models/operations/getpluginresponse.md - docs/models/operations/getpluginschemarequest.md - docs/models/operations/getpluginschemaresponse.md + - docs/models/operations/getpluginwithconsumergrouprequest.md + - docs/models/operations/getpluginwithconsumergroupresponse.md + - docs/models/operations/getpluginwithconsumerrequest.md + - docs/models/operations/getpluginwithconsumerresponse.md - docs/models/operations/getpluginwithrouterequest.md - docs/models/operations/getpluginwithrouteresponse.md - docs/models/operations/getpluginwithservicerequest.md @@ -913,6 +964,9 @@ generatedFiles: - docs/models/operations/listconsumerrequest.md - docs/models/operations/listconsumerresponse.md - docs/models/operations/listconsumerresponsebody.md + - docs/models/operations/listconsumersforconsumergrouprequest.md + - docs/models/operations/listconsumersforconsumergroupresponse.md + - docs/models/operations/listconsumersforconsumergroupresponsebody.md - docs/models/operations/listcontrolplanesrequest.md - docs/models/operations/listcontrolplanesresponse.md - docs/models/operations/listdataplanenodesrequest.md @@ -946,11 +1000,23 @@ generatedFiles: - docs/models/operations/listkeywithkeysetrequest.md - docs/models/operations/listkeywithkeysetresponse.md - docs/models/operations/listkeywithkeysetresponsebody.md + - docs/models/operations/listmtlsauthrequest.md + - docs/models/operations/listmtlsauthresponse.md + - docs/models/operations/listmtlsauthresponsebody.md + - docs/models/operations/listmtlsauthwithconsumerrequest.md + - docs/models/operations/listmtlsauthwithconsumerresponse.md + - docs/models/operations/listmtlsauthwithconsumerresponsebody.md - docs/models/operations/listpluginrequest.md - docs/models/operations/listpluginresponse.md - docs/models/operations/listpluginresponsebody.md - docs/models/operations/listpluginschemasrequest.md - docs/models/operations/listpluginschemasresponse.md + - docs/models/operations/listpluginwithconsumergrouprequest.md + - docs/models/operations/listpluginwithconsumergroupresponse.md + - docs/models/operations/listpluginwithconsumergroupresponsebody.md + - docs/models/operations/listpluginwithconsumerrequest.md + - docs/models/operations/listpluginwithconsumerresponse.md + - docs/models/operations/listpluginwithconsumerresponsebody.md - docs/models/operations/listpluginwithrouterequest.md - docs/models/operations/listpluginwithrouteresponse.md - docs/models/operations/listpluginwithrouteresponsebody.md @@ -1018,6 +1084,8 @@ generatedFiles: - docs/models/operations/putcontrolplanesidgroupmembershipsrequest.md - docs/models/operations/putcontrolplanesidgroupmembershipsresponse.md - docs/models/operations/queryparamfilter.md + - docs/models/operations/removeconsumerfromconsumergrouprequest.md + - docs/models/operations/removeconsumerfromconsumergroupresponse.md - docs/models/operations/removeconsumerfromgrouprequest.md - docs/models/operations/removeconsumerfromgroupresponse.md - docs/models/operations/removeuserfromteamrequest.md @@ -1062,8 +1130,14 @@ generatedFiles: - docs/models/operations/upsertkeysetresponse.md - docs/models/operations/upsertkeywithkeysetrequest.md - docs/models/operations/upsertkeywithkeysetresponse.md + - docs/models/operations/upsertmtlsauthwithconsumerrequest.md + - docs/models/operations/upsertmtlsauthwithconsumerresponse.md - docs/models/operations/upsertpluginrequest.md - docs/models/operations/upsertpluginresponse.md + - docs/models/operations/upsertpluginwithconsumergrouprequest.md + - docs/models/operations/upsertpluginwithconsumergroupresponse.md + - docs/models/operations/upsertpluginwithconsumerrequest.md + - docs/models/operations/upsertpluginwithconsumerresponse.md - docs/models/operations/upsertpluginwithrouterequest.md - docs/models/operations/upsertpluginwithrouteresponse.md - docs/models/operations/upsertpluginwithservicerequest.md @@ -1123,6 +1197,7 @@ generatedFiles: - me.go - models/operations/options.go - models/sdkerrors/sdkerror.go + - mtlsauthcredentials.go - plugins.go - retry/config.go - roles.go @@ -1814,7 +1889,7 @@ examples: parameters: path: controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" - ConsumerId: "c1059869-6fa7-4329-a5f5-5946d14ca2c5" + ConsumerId: "123e4567-e89b-12d3-a456-426614174000" responses: "401": application/json: {"message": "", "status": 616749} @@ -1825,7 +1900,7 @@ examples: parameters: path: controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" - ConsumerId: "c1059869-6fa7-4329-a5f5-5946d14ca2c5" + ConsumerId: "123e4567-e89b-12d3-a456-426614174000" requestBody: application/json: {"custom_id": "4200", "id": "8a388226-80e8-4027-a486-25e4f7db5d21", "tags": ["silver-tier"], "username": "bob-the-builder"} responses: @@ -1838,7 +1913,7 @@ examples: parameters: path: controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" - ConsumerId: "c1059869-6fa7-4329-a5f5-5946d14ca2c5" + ConsumerId: "123e4567-e89b-12d3-a456-426614174000" responses: "401": application/json: {"message": "", "status": 265954} @@ -2814,6 +2889,9 @@ examples: parameters: path: controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + responses: + "200": + application/json: {"expected_hash": "", "created_at": 586919, "updated_at": 525612} list-dataplane-nodes: speakeasy-default-list-dataplane-nodes: parameters: @@ -3505,6 +3583,8 @@ examples: application/problem+json: {"status": 346361, "title": "", "instance": "", "detail": "", "invalid_parameters": []} "404": application/problem+json: {"status": 404, "title": "Not Found", "type": "https://httpstatuses.com/404", "instance": "kong:trace:1234567890", "detail": "Not found"} + "409": + application/problem+json: {"status": 409, "title": "Conflict", "type": "https://httpstatuses.com/409", "instance": "kong:trace:1234567890", "detail": "Conflict"} remove-user-from-team: speakeasy-default-remove-user-from-team: parameters: @@ -3596,7 +3676,7 @@ examples: parameters: path: controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" - ConsumerId: "c1059869-6fa7-4329-a5f5-5946d14ca2c5" + ConsumerId: "123e4567-e89b-12d3-a456-426614174000" query: tags: "tag1,tag2" put-control-planes-id-group-memberships: @@ -3666,3 +3746,197 @@ examples: responses: "200": application/json: {"id": "d958f66b-8e99-44d2-b0b4-edd5bbf24658", "jwk": "{\"alg\":\"RSA\", \"kid\": \"42\", ...}", "kid": "42", "name": "a-key", "pem": {"private_key": "-----BEGIN", "public_key": "-----BEGIN"}, "set": {"id": "b86b331c-dcd0-4b3e-97ce-47c5a9543031"}} + list-consumers-for-consumer-group: + "": + parameters: + path: + ConsumerGroupId: "" + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + query: + tags: "tag1,tag2" + responses: + "200": + application/json: {"data": [{"custom_id": "4200", "id": "8a388226-80e8-4027-a486-25e4f7db5d21", "tags": ["silver-tier"], "username": "bob-the-builder"}]} + add-consumer-to-specific-consumer-group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerId: "123e4567-e89b-12d3-a456-426614174000" + requestBody: + application/json: {"group": "fedee695-2ae2-4e45-877a-776d9b2fc793"} + responses: + "201": + application/json: {"consumer": {"custom_id": "4200", "id": "8a388226-80e8-4027-a486-25e4f7db5d21", "tags": ["silver-tier"], "username": "bob-the-builder"}} + remove-consumer-from-consumer-group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerId: "123e4567-e89b-12d3-a456-426614174000" + ConsumerGroupId: "" + list-plugin-with-consumer_group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerGroupId: "" + query: + tags: "tag1,tag2" + responses: + "200": + application/json: {"data": [{"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]}]} + create-plugin-with-consumer_group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerGroupId: "" + requestBody: + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + responses: + "201": + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + delete-plugin-with-consumer_group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerGroupId: "" + PluginId: "3473c251-5b6c-4f45-b1ff-7ede735a366d" + get-plugin-with-consumer_group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerGroupId: "" + PluginId: "3473c251-5b6c-4f45-b1ff-7ede735a366d" + responses: + "200": + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + upsert-plugin-with-consumer_group: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerGroupId: "" + PluginId: "3473c251-5b6c-4f45-b1ff-7ede735a366d" + requestBody: + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + responses: + "200": + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + list-plugin-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + query: + tags: "tag1,tag2" + responses: + "200": + application/json: {"data": [{"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]}]} + create-plugin-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + requestBody: + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + responses: + "201": + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + delete-plugin-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + PluginId: "3473c251-5b6c-4f45-b1ff-7ede735a366d" + get-plugin-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + PluginId: "3473c251-5b6c-4f45-b1ff-7ede735a366d" + responses: + "200": + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + upsert-plugin-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + PluginId: "3473c251-5b6c-4f45-b1ff-7ede735a366d" + requestBody: + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + responses: + "200": + application/json: {"config": {"anonymous": "", "hide_credentials": false, "key_in_body": false, "key_in_header": true, "key_in_query": true, "key_names": ["apikey"], "run_on_preflight": true}, "enabled": true, "id": "3fd1eea1-885a-4011-b986-289943ff8177", "name": "key-auth", "protocols": ["grpc", "grpcs", "http", "https"]} + list-mtls-auth-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + query: + tags: "tag1,tag2" + responses: + "200": + application/json: {"data": [{"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "consumer": {"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"}]} + create-mtls-auth-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + requestBody: + application/json: {"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"} + responses: + "201": + application/json: {"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "consumer": {"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"} + delete-mtls-auth-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + MTLSAuthId: "" + get-mtls-auth-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + MTLSAuthId: "" + responses: + "200": + application/json: {"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "consumer": {"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"} + upsert-mtls-auth-with-consumer: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + ConsumerIdForNestedEntities: "f28acbfa-c866-4587-b688-0208ac24df21" + MTLSAuthId: "" + requestBody: + application/json: {"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"} + responses: + "200": + application/json: {"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "consumer": {"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"} + list-mtls-auth: + "": + parameters: + path: + controlPlaneId: "9524ec7d-36d9-465d-a8c5-83a3c9390458" + query: + tags: "tag1,tag2" + responses: + "200": + application/json: {"data": [{"ca_certificate": {"id": "b2f34145-0343-41a4-9602-4c69dec2f260"}, "consumer": {"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"}, "id": "b2f34145-0343-41a4-9602-4c69dec2f269", "subject_name": "CA_Subject_Name"}]} + "401": + application/json: {"message": "", "status": 846487} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index db739ca..e7fbe11 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,10 +13,11 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false go: - version: 0.1.5 + version: 0.1.6 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true + defaultErrorName: SDKError flattenGlobalSecurity: true imports: option: openapi diff --git a/README.md b/README.md index b9f3417..3345768 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ By Default, an API error will return `sdkerrors.SDKError`. When custom error res For example, the `ListControlPlanes` function may return the following errors: -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| sdkerrors.BadRequestError | 400 | application/problem+json | -| sdkerrors.UnauthorizedError | 401 | application/problem+json | -| sdkerrors.ForbiddenError | 403 | application/problem+json | -| sdkerrors.ServiceUnavailable | 503 | application/problem+json | -| sdkerrors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ----------- | ------------------------ | +| sdkerrors.BadRequestError | 400 | application/problem+json | +| sdkerrors.UnauthorizedError | 401 | application/problem+json | +| sdkerrors.ForbiddenError | 403 | application/problem+json | +| sdkerrors.ServiceUnavailable | 503 | application/problem+json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ### Example @@ -96,14 +96,14 @@ func main() { ### Select Server by Index -You can override the default server globally using the `WithServerIndex` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: +You can override the default server globally using the `WithServerIndex(serverIndex int)` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://global.api.konghq.com` | None | -| 1 | `https://us.api.konghq.com` | None | -| 2 | `https://eu.api.konghq.com` | None | -| 3 | `https://au.api.konghq.com` | None | +| # | Server | +| --- | ------------------------------- | +| 0 | `https://global.api.konghq.com` | +| 1 | `https://us.api.konghq.com` | +| 2 | `https://eu.api.konghq.com` | +| 3 | `https://au.api.konghq.com` | #### Example @@ -146,10 +146,9 @@ func main() { ``` - ### Override Server URL Per-Client -The default server can also be overridden globally using the `WithServerURL` option when initializing the SDK client instance. For example: +The default server can also be overridden globally using the `WithServerURL(serverURL string)` option when initializing the SDK client instance. For example: ```go package main @@ -259,11 +258,11 @@ This can be a convenient way to configure timeouts, cookies, proxies, custom hea This SDK supports the following security schemes globally: -| Name | Type | Scheme | -| -------------------------- | -------------------------- | -------------------------- | -| `PersonalAccessToken` | http | HTTP Bearer | -| `SystemAccountAccessToken` | http | HTTP Bearer | -| `KonnectAccessToken` | http | HTTP Bearer | +| Name | Type | Scheme | +| -------------------------- | ---- | ----------- | +| `PersonalAccessToken` | http | HTTP Bearer | +| `SystemAccountAccessToken` | http | HTTP Bearer | +| `KonnectAccessToken` | http | HTTP Bearer | You can set the security parameters through the `WithSecurity` option when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example: ```go diff --git a/consumergroups.go b/consumergroups.go index fcb5504..e6b3a4f 100644 --- a/consumergroups.go +++ b/consumergroups.go @@ -1060,6 +1060,193 @@ func (s *ConsumerGroups) UpsertConsumerGroup(ctx context.Context, request operat } +// ListConsumersForConsumerGroup - List all Consumers in a Consumer Group +// List all consumers in a consumer group +func (s *ConsumerGroups) ListConsumersForConsumerGroup(ctx context.Context, request operations.ListConsumersForConsumerGroupRequest, opts ...operations.Option) (*operations.ListConsumersForConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-consumers-for-consumer-group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/consumers", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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); 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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListConsumersForConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.ListConsumersForConsumerGroupResponseBody + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // AddConsumerToGroup - Add consumer to consumer group // Add a consumer to a consumer group func (s *ConsumerGroups) AddConsumerToGroup(ctx context.Context, request operations.AddConsumerToGroupRequest, opts ...operations.Option) (*operations.AddConsumerToGroupResponse, error) { @@ -1598,3 +1785,355 @@ func (s *ConsumerGroups) ListConsumerGroupsForConsumer(ctx context.Context, requ return res, nil } + +// AddConsumerToSpecificConsumerGroup - Add consumer to a specific consumer group +// Add a consumer to a consumer group +func (s *ConsumerGroups) AddConsumerToSpecificConsumerGroup(ctx context.Context, request operations.AddConsumerToSpecificConsumerGroupRequest, opts ...operations.Option) (*operations.AddConsumerToSpecificConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "add-consumer-to-specific-consumer-group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "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, "POST", 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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.AddConsumerToSpecificConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + 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 operations.AddConsumerToSpecificConsumerGroupResponseBody + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// RemoveConsumerFromConsumerGroup - Remove consumer from consumer group +// Removes a consumer from a consumer group. This operation does not delete the consumer group. +func (s *ConsumerGroups) RemoveConsumerFromConsumerGroup(ctx context.Context, request operations.RemoveConsumerFromConsumerGroupRequest, opts ...operations.Option) (*operations.RemoveConsumerFromConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "remove-consumer-from-consumer-group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups/{ConsumerGroupId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.RemoveConsumerFromConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/docs/models/components/acl.md b/docs/models/components/acl.md index 21d6ffb..b9fbe0b 100644 --- a/docs/models/components/acl.md +++ b/docs/models/components/acl.md @@ -7,6 +7,6 @@ | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | | `Consumer` | [*components.ACLConsumer](../../models/components/aclconsumer.md) | :heavy_minus_sign: | N/A | | `CreatedAt` | **int64* | :heavy_minus_sign: | Unix epoch when the resource was created. | -| `Group` | **string* | :heavy_minus_sign: | N/A | +| `Group` | *string* | :heavy_check_mark: | N/A | | `ID` | **string* | :heavy_minus_sign: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/aclwithoutparents.md b/docs/models/components/aclwithoutparents.md index b0e2410..a753761 100644 --- a/docs/models/components/aclwithoutparents.md +++ b/docs/models/components/aclwithoutparents.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `Group` | **string* | :heavy_minus_sign: | N/A | +| `Group` | *string* | :heavy_check_mark: | N/A | | `ID` | **string* | :heavy_minus_sign: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/basicauth.md b/docs/models/components/basicauth.md index 6b753d4..8b6c030 100644 --- a/docs/models/components/basicauth.md +++ b/docs/models/components/basicauth.md @@ -8,6 +8,6 @@ | `Consumer` | [*components.BasicAuthConsumer](../../models/components/basicauthconsumer.md) | :heavy_minus_sign: | N/A | | `CreatedAt` | **int64* | :heavy_minus_sign: | Unix epoch when the resource was created. | | `ID` | **string* | :heavy_minus_sign: | N/A | -| `Password` | **string* | :heavy_minus_sign: | N/A | +| `Password` | *string* | :heavy_check_mark: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | -| `Username` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/basicauthwithoutparents.md b/docs/models/components/basicauthwithoutparents.md index c4c7f2d..7ebc3af 100644 --- a/docs/models/components/basicauthwithoutparents.md +++ b/docs/models/components/basicauthwithoutparents.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `ID` | **string* | :heavy_minus_sign: | N/A | -| `Password` | **string* | :heavy_minus_sign: | N/A | +| `Password` | *string* | :heavy_check_mark: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | -| `Username` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/certificate.md b/docs/models/components/certificate.md index 8fb031d..0964806 100644 --- a/docs/models/components/certificate.md +++ b/docs/models/components/certificate.md @@ -13,5 +13,6 @@ A certificate object represents a public certificate, and can be optionally pair | `ID` | **string* | :heavy_minus_sign: | N/A | | `Key` | *string* | :heavy_check_mark: | PEM-encoded private key of the SSL key pair. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). | | `KeyAlt` | **string* | :heavy_minus_sign: | PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). | +| `Snis` | []*string* | :heavy_minus_sign: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | An optional set of strings associated with the Certificate for grouping and filtering. | | `UpdatedAt` | **int64* | :heavy_minus_sign: | Unix epoch when the resource was last updated. | \ No newline at end of file diff --git a/docs/models/components/certificateinput.md b/docs/models/components/certificateinput.md index 04c26b5..97bf386 100644 --- a/docs/models/components/certificateinput.md +++ b/docs/models/components/certificateinput.md @@ -12,4 +12,5 @@ A certificate object represents a public certificate, and can be optionally pair | `ID` | **string* | :heavy_minus_sign: | N/A | | `Key` | *string* | :heavy_check_mark: | PEM-encoded private key of the SSL key pair. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). | | `KeyAlt` | **string* | :heavy_minus_sign: | PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). | +| `Snis` | []*string* | :heavy_minus_sign: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | An optional set of strings associated with the Certificate for grouping and filtering. | \ No newline at end of file diff --git a/docs/models/components/controlplaneclustertype.md b/docs/models/components/controlplaneclustertype.md index d98b9c5..1234318 100644 --- a/docs/models/components/controlplaneclustertype.md +++ b/docs/models/components/controlplaneclustertype.md @@ -8,7 +8,6 @@ The ClusterType value of the cluster associated with the Control Plane. | Name | Value | | -------------------------------------------------------- | -------------------------------------------------------- | | `ControlPlaneClusterTypeClusterTypeControlPlane` | CLUSTER_TYPE_CONTROL_PLANE | -| `ControlPlaneClusterTypeClusterTypeHybrid` | CLUSTER_TYPE_HYBRID | | `ControlPlaneClusterTypeClusterTypeK8SIngressController` | CLUSTER_TYPE_K8S_INGRESS_CONTROLLER | | `ControlPlaneClusterTypeClusterTypeControlPlaneGroup` | CLUSTER_TYPE_CONTROL_PLANE_GROUP | | `ControlPlaneClusterTypeClusterTypeServerless` | CLUSTER_TYPE_SERVERLESS | \ No newline at end of file diff --git a/docs/models/components/getexpectedconfighash.md b/docs/models/components/getexpectedconfighashresponse.md similarity index 52% rename from docs/models/components/getexpectedconfighash.md rename to docs/models/components/getexpectedconfighashresponse.md index 28e885a..fbaa389 100644 --- a/docs/models/components/getexpectedconfighash.md +++ b/docs/models/components/getexpectedconfighashresponse.md @@ -1,4 +1,4 @@ -# GetExpectedConfigHash +# GetExpectedConfigHashResponse Response body for retrieving the expected config hash of the control plane. @@ -7,6 +7,6 @@ Response body for retrieving the expected config hash of the control plane. | Field | Type | Required | Description | | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ExpectedHash` | **string* | :heavy_minus_sign: | The expected configuration hash. | -| `CreatedAt` | **int64* | :heavy_minus_sign: | Date the control plane configuration was created. | -| `UpdatedAt` | **int64* | :heavy_minus_sign: | Date the control plane configuration was last updated. | \ No newline at end of file +| `ExpectedHash` | *string* | :heavy_check_mark: | The expected configuration hash. | +| `CreatedAt` | *int64* | :heavy_check_mark: | Date the control plane configuration was created. | +| `UpdatedAt` | *int64* | :heavy_check_mark: | Date the control plane configuration was last updated. | \ No newline at end of file diff --git a/docs/models/components/groupconflict.md b/docs/models/components/groupconflict.md index 4b51b6d..3016375 100644 --- a/docs/models/components/groupconflict.md +++ b/docs/models/components/groupconflict.md @@ -5,8 +5,8 @@ The Group Conflict object contains information about a conflict in a control pla ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `ClusterID` | **string* | :heavy_minus_sign: | The ID of a control plane member of a control plane group. | 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7 | -| `Description` | **string* | :heavy_minus_sign: | The description of the conflict. | conflicting entity found: ID=38d790ad-8b08-4ff5-a074-2e1e9e64d8bd, Name=foo | -| `Resource` | [*components.GroupConflictResource](../../models/components/groupconflictresource.md) | :heavy_minus_sign: | A resource causing a conflict in a control plane group. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ClusterID` | *string* | :heavy_check_mark: | The ID of a control plane member of a control plane group. | 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7 | +| `Description` | *string* | :heavy_check_mark: | The description of the conflict. | conflicting entity found: ID=38d790ad-8b08-4ff5-a074-2e1e9e64d8bd, Name=foo | +| `Resource` | [components.GroupConflictResource](../../models/components/groupconflictresource.md) | :heavy_check_mark: | A resource causing a conflict in a control plane group. | | \ No newline at end of file diff --git a/docs/models/components/groupmembership.md b/docs/models/components/groupmembership.md index 5a954f8..4d5286f 100644 --- a/docs/models/components/groupmembership.md +++ b/docs/models/components/groupmembership.md @@ -7,4 +7,4 @@ Request body for upserting a list of child control planes to a control plane gro | Field | Type | Required | Description | | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `Members` | [][components.Members](../../models/components/members.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Members` | [][components.Members](../../models/components/members.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/groupstatus.md b/docs/models/components/groupstatus.md index 2f7c32a..465a681 100644 --- a/docs/models/components/groupstatus.md +++ b/docs/models/components/groupstatus.md @@ -7,8 +7,8 @@ The Group Status object contains information about the status of a control plane | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | The control plane group ID. | 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7 | -| `CreatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | An ISO-8604 timestamp representation of control plane group status creation date. | 2022-11-04T20:10:06.927Z | -| `UpdatedAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | An ISO-8604 timestamp representation of control plane group status update date. | 2022-11-04T20:10:06.927Z | +| `ID` | *string* | :heavy_check_mark: | The control plane group ID. | 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7 | +| `CreatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | An ISO-8604 timestamp representation of control plane group status creation date. | 2022-11-04T20:10:06.927Z | +| `UpdatedAt` | [time.Time](https://pkg.go.dev/time#Time) | :heavy_check_mark: | An ISO-8604 timestamp representation of control plane group status update date. | 2022-11-04T20:10:06.927Z | | `Conflicts` | [][components.GroupConflict](../../models/components/groupconflict.md) | :heavy_minus_sign: | N/A | | -| `State` | [*components.State](../../models/components/state.md) | :heavy_minus_sign: | The state of the control plane group. | CONFLICT | \ No newline at end of file +| `State` | [components.State](../../models/components/state.md) | :heavy_check_mark: | The state of the control plane group. | CONFLICT | \ No newline at end of file diff --git a/docs/models/components/hmacauth.md b/docs/models/components/hmacauth.md index 03e1583..c7f071c 100644 --- a/docs/models/components/hmacauth.md +++ b/docs/models/components/hmacauth.md @@ -10,4 +10,4 @@ | `ID` | **string* | :heavy_minus_sign: | N/A | | `Secret` | **string* | :heavy_minus_sign: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | -| `Username` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/hmacauthwithoutparents.md b/docs/models/components/hmacauthwithoutparents.md index 112383f..12556df 100644 --- a/docs/models/components/hmacauthwithoutparents.md +++ b/docs/models/components/hmacauthwithoutparents.md @@ -8,4 +8,4 @@ | `ID` | **string* | :heavy_minus_sign: | N/A | | `Secret` | **string* | :heavy_minus_sign: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | -| `Username` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/invalidparametermaximumlength.md b/docs/models/components/invalidparametermaximumlength.md new file mode 100644 index 0000000..4e4dbde --- /dev/null +++ b/docs/models/components/invalidparametermaximumlength.md @@ -0,0 +1,12 @@ +# InvalidParameterMaximumLength + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Field` | *string* | :heavy_check_mark: | N/A | name | +| `Rule` | [components.InvalidParameterMaximumLengthRule](../../models/components/invalidparametermaximumlengthrule.md) | :heavy_check_mark: | invalid parameters rules | | +| `Maximum` | *int64* | :heavy_check_mark: | N/A | 8 | +| `Source` | **string* | :heavy_minus_sign: | N/A | body | +| `Reason` | *string* | :heavy_check_mark: | N/A | must not have more than 8 characters | \ No newline at end of file diff --git a/docs/models/components/invalidparametermaximumlengthrule.md b/docs/models/components/invalidparametermaximumlengthrule.md new file mode 100644 index 0000000..858ccd6 --- /dev/null +++ b/docs/models/components/invalidparametermaximumlengthrule.md @@ -0,0 +1,12 @@ +# InvalidParameterMaximumLengthRule + +invalid parameters rules + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `InvalidParameterMaximumLengthRuleMaxLength` | max_length | +| `InvalidParameterMaximumLengthRuleMaxItems` | max_items | +| `InvalidParameterMaximumLengthRuleMax` | max | \ No newline at end of file diff --git a/docs/models/components/invalidparameterminimumlength.md b/docs/models/components/invalidparameterminimumlength.md index af5384d..1cb0e40 100644 --- a/docs/models/components/invalidparameterminimumlength.md +++ b/docs/models/components/invalidparameterminimumlength.md @@ -9,4 +9,4 @@ | `Rule` | [components.Rule](../../models/components/rule.md) | :heavy_check_mark: | invalid parameters rules | | | `Minimum` | *int64* | :heavy_check_mark: | N/A | 8 | | `Source` | **string* | :heavy_minus_sign: | N/A | body | -| `Reason` | *string* | :heavy_check_mark: | N/A | is a required field | \ No newline at end of file +| `Reason` | *string* | :heavy_check_mark: | N/A | must have at least 8 characters | \ No newline at end of file diff --git a/docs/models/components/invalidparameters.md b/docs/models/components/invalidparameters.md index e6a9a4d..a7206f3 100644 --- a/docs/models/components/invalidparameters.md +++ b/docs/models/components/invalidparameters.md @@ -15,6 +15,12 @@ invalidParameters := components.CreateInvalidParametersInvalidParameterStandard( invalidParameters := components.CreateInvalidParametersInvalidParameterMinimumLength(components.InvalidParameterMinimumLength{/* values here */}) ``` +### InvalidParameterMaximumLength + +```go +invalidParameters := components.CreateInvalidParametersInvalidParameterMaximumLength(components.InvalidParameterMaximumLength{/* values here */}) +``` + ### InvalidParameterChoiceItem ```go diff --git a/docs/models/components/invalidrules.md b/docs/models/components/invalidrules.md index 943dff1..d2cb8ca 100644 --- a/docs/models/components/invalidrules.md +++ b/docs/models/components/invalidrules.md @@ -8,7 +8,6 @@ invalid parameters rules | Name | Value | | ---------------------------------------------------- | ---------------------------------------------------- | | `InvalidRulesRequired` | required | -| `InvalidRulesMaxLength` | max_length | | `InvalidRulesIsArray` | is_array | | `InvalidRulesIsBase64` | is_base64 | | `InvalidRulesIsBoolean` | is_boolean | diff --git a/docs/models/components/keyauth.md b/docs/models/components/keyauth.md index cb3776e..1c46d13 100644 --- a/docs/models/components/keyauth.md +++ b/docs/models/components/keyauth.md @@ -8,5 +8,5 @@ | `Consumer` | [*components.KeyAuthConsumer](../../models/components/keyauthconsumer.md) | :heavy_minus_sign: | N/A | | `CreatedAt` | **int64* | :heavy_minus_sign: | Unix epoch when the resource was created. | | `ID` | **string* | :heavy_minus_sign: | N/A | -| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Key` | *string* | :heavy_check_mark: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/keyauthwithoutparents.md b/docs/models/components/keyauthwithoutparents.md index de8a132..6d5a735 100644 --- a/docs/models/components/keyauthwithoutparents.md +++ b/docs/models/components/keyauthwithoutparents.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | | `ID` | **string* | :heavy_minus_sign: | N/A | -| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Key` | *string* | :heavy_check_mark: | N/A | | `Tags` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/listgroupmemberships.md b/docs/models/components/listgroupmemberships.md index 3b00cc1..db1c5ba 100644 --- a/docs/models/components/listgroupmemberships.md +++ b/docs/models/components/listgroupmemberships.md @@ -5,7 +5,7 @@ A paginated list response for a collection of control plane group memberships. ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `Meta` | [*components.CursorPaginatedMetaWithSizeAndTotal](../../models/components/cursorpaginatedmetawithsizeandtotal.md) | :heavy_minus_sign: | returns the pagination information | -| `Data` | [][components.ControlPlane](../../models/components/controlplane.md) | :heavy_minus_sign: | Array of control planes summary who are a child to this control plane group. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Meta` | [components.CursorPaginatedMetaWithSizeAndTotal](../../models/components/cursorpaginatedmetawithsizeandtotal.md) | :heavy_check_mark: | returns the pagination information | +| `Data` | [][components.ControlPlane](../../models/components/controlplane.md) | :heavy_check_mark: | Array of control planes summary who are a child to this control plane group. | \ No newline at end of file diff --git a/docs/models/components/members.md b/docs/models/components/members.md index 5a560bc..5f5ab44 100644 --- a/docs/models/components/members.md +++ b/docs/models/components/members.md @@ -5,4 +5,4 @@ | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `ID` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/meorganizationstate.md b/docs/models/components/meorganizationstate.md index ad90698..d9f17c1 100644 --- a/docs/models/components/meorganizationstate.md +++ b/docs/models/components/meorganizationstate.md @@ -8,4 +8,6 @@ State of the organization | Name | Value | | ----------------------------- | ----------------------------- | | `MeOrganizationStateActive` | active | -| `MeOrganizationStateInactive` | inactive | \ No newline at end of file +| `MeOrganizationStateInactive` | inactive | +| `MeOrganizationStateDeleting` | deleting | +| `MeOrganizationStateDeleted` | deleted | \ No newline at end of file diff --git a/docs/models/components/mtlsauth.md b/docs/models/components/mtlsauth.md new file mode 100644 index 0000000..9da3947 --- /dev/null +++ b/docs/models/components/mtlsauth.md @@ -0,0 +1,13 @@ +# MTLSAuth + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `CaCertificate` | [*components.MTLSAuthCaCertificate](../../models/components/mtlsauthcacertificate.md) | :heavy_minus_sign: | N/A | +| `Consumer` | [*components.MTLSAuthConsumer](../../models/components/mtlsauthconsumer.md) | :heavy_minus_sign: | N/A | +| `CreatedAt` | **int64* | :heavy_minus_sign: | Unix epoch when the resource was created. | +| `ID` | **string* | :heavy_minus_sign: | N/A | +| `SubjectName` | *string* | :heavy_check_mark: | N/A | +| `Tags` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mtlsauthcacertificate.md b/docs/models/components/mtlsauthcacertificate.md new file mode 100644 index 0000000..c898220 --- /dev/null +++ b/docs/models/components/mtlsauthcacertificate.md @@ -0,0 +1,8 @@ +# MTLSAuthCaCertificate + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mtlsauthconsumer.md b/docs/models/components/mtlsauthconsumer.md new file mode 100644 index 0000000..98d3359 --- /dev/null +++ b/docs/models/components/mtlsauthconsumer.md @@ -0,0 +1,8 @@ +# MTLSAuthConsumer + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mtlsauthwithoutparents.md b/docs/models/components/mtlsauthwithoutparents.md new file mode 100644 index 0000000..5bf8bce --- /dev/null +++ b/docs/models/components/mtlsauthwithoutparents.md @@ -0,0 +1,11 @@ +# MTLSAuthWithoutParents + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `CaCertificate` | [*components.MTLSAuthWithoutParentsCaCertificate](../../models/components/mtlsauthwithoutparentscacertificate.md) | :heavy_minus_sign: | N/A | +| `ID` | **string* | :heavy_minus_sign: | N/A | +| `SubjectName` | *string* | :heavy_check_mark: | N/A | +| `Tags` | []*string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/mtlsauthwithoutparentscacertificate.md b/docs/models/components/mtlsauthwithoutparentscacertificate.md new file mode 100644 index 0000000..0419d1b --- /dev/null +++ b/docs/models/components/mtlsauthwithoutparentscacertificate.md @@ -0,0 +1,8 @@ +# MTLSAuthWithoutParentsCaCertificate + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/rule.md b/docs/models/components/rule.md index ec31b3f..613a0fa 100644 --- a/docs/models/components/rule.md +++ b/docs/models/components/rule.md @@ -11,4 +11,6 @@ invalid parameters rules | `RuleMinDigits` | min_digits | | `RuleMinLowercase` | min_lowercase | | `RuleMinUppercase` | min_uppercase | -| `RuleMinSymbols` | min_symbols | \ No newline at end of file +| `RuleMinSymbols` | min_symbols | +| `RuleMinItems` | min_items | +| `RuleMin` | min | \ No newline at end of file diff --git a/docs/models/components/service.md b/docs/models/components/service.md index bb8bed1..3761bd0 100644 --- a/docs/models/components/service.md +++ b/docs/models/components/service.md @@ -16,8 +16,8 @@ Service entities, as the name implies, are abstractions of each of your own upst | `ID` | **string* | :heavy_minus_sign: | N/A | | `Name` | **string* | :heavy_minus_sign: | The Service name. | | `Path` | **string* | :heavy_minus_sign: | The path to be used in requests to the upstream server. | -| `Port` | **int64* | :heavy_minus_sign: | The upstream server port. | -| `Protocol` | [*components.Protocol](../../models/components/protocol.md) | :heavy_minus_sign: | The protocol used to communicate with the upstream. | +| `Port` | *int64* | :heavy_check_mark: | The upstream server port. | +| `Protocol` | [components.Protocol](../../models/components/protocol.md) | :heavy_check_mark: | The protocol used to communicate with the upstream. | | `ReadTimeout` | **int64* | :heavy_minus_sign: | The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. | | `Retries` | **int64* | :heavy_minus_sign: | The number of retries to execute upon failure to proxy. | | `Tags` | []*string* | :heavy_minus_sign: | An optional set of strings associated with the Service for grouping and filtering. | diff --git a/docs/models/components/serviceinput.md b/docs/models/components/serviceinput.md index c621251..9aaeb09 100644 --- a/docs/models/components/serviceinput.md +++ b/docs/models/components/serviceinput.md @@ -15,8 +15,8 @@ Service entities, as the name implies, are abstractions of each of your own upst | `ID` | **string* | :heavy_minus_sign: | N/A | | `Name` | **string* | :heavy_minus_sign: | The Service name. | | `Path` | **string* | :heavy_minus_sign: | The path to be used in requests to the upstream server. | -| `Port` | **int64* | :heavy_minus_sign: | The upstream server port. | -| `Protocol` | [*components.Protocol](../../models/components/protocol.md) | :heavy_minus_sign: | The protocol used to communicate with the upstream. | +| `Port` | *int64* | :heavy_check_mark: | The upstream server port. | +| `Protocol` | [components.Protocol](../../models/components/protocol.md) | :heavy_check_mark: | The protocol used to communicate with the upstream. | | `ReadTimeout` | **int64* | :heavy_minus_sign: | The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. | | `Retries` | **int64* | :heavy_minus_sign: | The number of retries to execute upon failure to proxy. | | `Tags` | []*string* | :heavy_minus_sign: | An optional set of strings associated with the Service for grouping and filtering. | diff --git a/docs/models/operations/addconsumertospecificconsumergrouprequest.md b/docs/models/operations/addconsumertospecificconsumergrouprequest.md new file mode 100644 index 0000000..10e7760 --- /dev/null +++ b/docs/models/operations/addconsumertospecificconsumergrouprequest.md @@ -0,0 +1,10 @@ +# AddConsumerToSpecificConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerID` | *string* | :heavy_check_mark: | The UUID of the consumer. | 123e4567-e89b-12d3-a456-426614174000 | +| `RequestBody` | [*operations.AddConsumerToSpecificConsumerGroupRequestBody](../../models/operations/addconsumertospecificconsumergrouprequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/addconsumertospecificconsumergrouprequestbody.md b/docs/models/operations/addconsumertospecificconsumergrouprequestbody.md new file mode 100644 index 0000000..05bed20 --- /dev/null +++ b/docs/models/operations/addconsumertospecificconsumergrouprequestbody.md @@ -0,0 +1,8 @@ +# AddConsumerToSpecificConsumerGroupRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `Group` | **string* | :heavy_minus_sign: | N/A | fedee695-2ae2-4e45-877a-776d9b2fc793 | \ No newline at end of file diff --git a/docs/models/operations/addconsumertospecificconsumergroupresponse.md b/docs/models/operations/addconsumertospecificconsumergroupresponse.md new file mode 100644 index 0000000..2203528 --- /dev/null +++ b/docs/models/operations/addconsumertospecificconsumergroupresponse.md @@ -0,0 +1,11 @@ +# AddConsumerToSpecificConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.AddConsumerToSpecificConsumerGroupResponseBody](../../models/operations/addconsumertospecificconsumergroupresponsebody.md) | :heavy_minus_sign: | Consumer added to a specific group | \ No newline at end of file diff --git a/docs/models/operations/addconsumertospecificconsumergroupresponsebody.md b/docs/models/operations/addconsumertospecificconsumergroupresponsebody.md new file mode 100644 index 0000000..dfa0f25 --- /dev/null +++ b/docs/models/operations/addconsumertospecificconsumergroupresponsebody.md @@ -0,0 +1,11 @@ +# AddConsumerToSpecificConsumerGroupResponseBody + +Consumer added to a specific group + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Consumer` | [*components.Consumer](../../models/components/consumer.md) | :heavy_minus_sign: | The Consumer object represents a consumer - or a user - of a Service. You can either rely on Kong as the primary datastore, or you can map the consumer list with your database to keep consistency between Kong and your existing primary datastore. | {
"custom_id": "4200",
"id": "8a388226-80e8-4027-a486-25e4f7db5d21",
"tags": [
"silver-tier"
],
"username": "bob-the-builder"
} | +| `ConsumerGroups` | [][components.ConsumerGroup](../../models/components/consumergroup.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/createmtlsauthwithconsumerrequest.md b/docs/models/operations/createmtlsauthwithconsumerrequest.md new file mode 100644 index 0000000..7f95e64 --- /dev/null +++ b/docs/models/operations/createmtlsauthwithconsumerrequest.md @@ -0,0 +1,10 @@ +# CreateMtlsAuthWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `MTLSAuthWithoutParents` | [components.MTLSAuthWithoutParents](../../models/components/mtlsauthwithoutparents.md) | :heavy_check_mark: | Description of new MTLS-auth credential for creation | {
"ca_certificate": {
"id": "b2f34145-0343-41a4-9602-4c69dec2f260"
},
"id": "b2f34145-0343-41a4-9602-4c69dec2f269",
"subject_name": "CA_Subject_Name"
} | \ No newline at end of file diff --git a/docs/models/operations/createmtlsauthwithconsumerresponse.md b/docs/models/operations/createmtlsauthwithconsumerresponse.md new file mode 100644 index 0000000..3d0cf87 --- /dev/null +++ b/docs/models/operations/createmtlsauthwithconsumerresponse.md @@ -0,0 +1,11 @@ +# CreateMtlsAuthWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `MTLSAuth` | [*components.MTLSAuth](../../models/components/mtlsauth.md) | :heavy_minus_sign: | Successfully created MTLS-auth credential | {
"ca_certificate": {
"id": "b2f34145-0343-41a4-9602-4c69dec2f260"
},
"consumer": {
"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"
},
"id": "b2f34145-0343-41a4-9602-4c69dec2f269",
"subject_name": "CA_Subject_Name"
} | \ No newline at end of file diff --git a/docs/models/operations/createpluginwithconsumergrouprequest.md b/docs/models/operations/createpluginwithconsumergrouprequest.md new file mode 100644 index 0000000..3d62bf6 --- /dev/null +++ b/docs/models/operations/createpluginwithconsumergrouprequest.md @@ -0,0 +1,10 @@ +# CreatePluginWithConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | ID of the Consumer Group to lookup | | +| `PluginWithoutParents` | [components.PluginWithoutParents](../../models/components/pluginwithoutparents.md) | :heavy_check_mark: | Description of new Plugin for creation | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/createpluginwithconsumergroupresponse.md b/docs/models/operations/createpluginwithconsumergroupresponse.md new file mode 100644 index 0000000..7cbb3a4 --- /dev/null +++ b/docs/models/operations/createpluginwithconsumergroupresponse.md @@ -0,0 +1,11 @@ +# CreatePluginWithConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Plugin` | [*components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | Successfully created Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/createpluginwithconsumerrequest.md b/docs/models/operations/createpluginwithconsumerrequest.md new file mode 100644 index 0000000..6db9d9e --- /dev/null +++ b/docs/models/operations/createpluginwithconsumerrequest.md @@ -0,0 +1,10 @@ +# CreatePluginWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `PluginWithoutParents` | [components.PluginWithoutParents](../../models/components/pluginwithoutparents.md) | :heavy_check_mark: | Description of new Plugin for creation | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/createpluginwithconsumerresponse.md b/docs/models/operations/createpluginwithconsumerresponse.md new file mode 100644 index 0000000..6697744 --- /dev/null +++ b/docs/models/operations/createpluginwithconsumerresponse.md @@ -0,0 +1,11 @@ +# CreatePluginWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Plugin` | [*components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | Successfully created Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/deleteconsumerrequest.md b/docs/models/operations/deleteconsumerrequest.md index dc6c770..791a36f 100644 --- a/docs/models/operations/deleteconsumerrequest.md +++ b/docs/models/operations/deleteconsumerrequest.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | -| `ConsumerID` | *string* | :heavy_check_mark: | ID of the Consumer to lookup | c1059869-6fa7-4329-a5f5-5946d14ca2c5 | \ No newline at end of file +| `ConsumerID` | *string* | :heavy_check_mark: | The UUID of the consumer. | 123e4567-e89b-12d3-a456-426614174000 | \ No newline at end of file diff --git a/docs/models/operations/deletemtlsauthwithconsumerrequest.md b/docs/models/operations/deletemtlsauthwithconsumerrequest.md new file mode 100644 index 0000000..623fdfa --- /dev/null +++ b/docs/models/operations/deletemtlsauthwithconsumerrequest.md @@ -0,0 +1,10 @@ +# DeleteMtlsAuthWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `MTLSAuthID` | *string* | :heavy_check_mark: | ID of the MTLS-auth credential to lookup | | \ No newline at end of file diff --git a/docs/models/operations/deletemtlsauthwithconsumerresponse.md b/docs/models/operations/deletemtlsauthwithconsumerresponse.md new file mode 100644 index 0000000..bf7dfec --- /dev/null +++ b/docs/models/operations/deletemtlsauthwithconsumerresponse.md @@ -0,0 +1,10 @@ +# DeleteMtlsAuthWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletepluginwithconsumergrouprequest.md b/docs/models/operations/deletepluginwithconsumergrouprequest.md new file mode 100644 index 0000000..5d86005 --- /dev/null +++ b/docs/models/operations/deletepluginwithconsumergrouprequest.md @@ -0,0 +1,10 @@ +# DeletePluginWithConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | ID of the Consumer Group to lookup | | +| `PluginID` | *string* | :heavy_check_mark: | ID of the Plugin to lookup | 3473c251-5b6c-4f45-b1ff-7ede735a366d | \ No newline at end of file diff --git a/docs/models/operations/deletepluginwithconsumergroupresponse.md b/docs/models/operations/deletepluginwithconsumergroupresponse.md new file mode 100644 index 0000000..de3ac51 --- /dev/null +++ b/docs/models/operations/deletepluginwithconsumergroupresponse.md @@ -0,0 +1,10 @@ +# DeletePluginWithConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletepluginwithconsumerrequest.md b/docs/models/operations/deletepluginwithconsumerrequest.md new file mode 100644 index 0000000..72e8131 --- /dev/null +++ b/docs/models/operations/deletepluginwithconsumerrequest.md @@ -0,0 +1,10 @@ +# DeletePluginWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `PluginID` | *string* | :heavy_check_mark: | ID of the Plugin to lookup | 3473c251-5b6c-4f45-b1ff-7ede735a366d | \ No newline at end of file diff --git a/docs/models/operations/deletepluginwithconsumerresponse.md b/docs/models/operations/deletepluginwithconsumerresponse.md new file mode 100644 index 0000000..15b6de4 --- /dev/null +++ b/docs/models/operations/deletepluginwithconsumerresponse.md @@ -0,0 +1,10 @@ +# DeletePluginWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getconsumerrequest.md b/docs/models/operations/getconsumerrequest.md index 8145365..dc9e666 100644 --- a/docs/models/operations/getconsumerrequest.md +++ b/docs/models/operations/getconsumerrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `ConsumerID` | *string* | :heavy_check_mark: | ID of the Consumer to lookup | c1059869-6fa7-4329-a5f5-5946d14ca2c5 | +| `ConsumerID` | *string* | :heavy_check_mark: | The UUID of the consumer. | 123e4567-e89b-12d3-a456-426614174000 | | `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | \ No newline at end of file diff --git a/docs/models/operations/getexpectedconfighashresponse.md b/docs/models/operations/getexpectedconfighashresponse.md index d8fd552..780bea7 100644 --- a/docs/models/operations/getexpectedconfighashresponse.md +++ b/docs/models/operations/getexpectedconfighashresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `GetExpectedConfigHash` | [*components.GetExpectedConfigHash](../../models/components/getexpectedconfighash.md) | :heavy_minus_sign: | Response body for retrieving the expected config hash of the control plane. | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `GetExpectedConfigHashResponse` | [*components.GetExpectedConfigHashResponse](../../models/components/getexpectedconfighashresponse.md) | :heavy_minus_sign: | Response body for retrieving the expected config hash of the control plane. | \ No newline at end of file diff --git a/docs/models/operations/getmtlsauthwithconsumerrequest.md b/docs/models/operations/getmtlsauthwithconsumerrequest.md new file mode 100644 index 0000000..af06a37 --- /dev/null +++ b/docs/models/operations/getmtlsauthwithconsumerrequest.md @@ -0,0 +1,10 @@ +# GetMtlsAuthWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `MTLSAuthID` | *string* | :heavy_check_mark: | ID of the MTLS-auth credential to lookup | | \ No newline at end of file diff --git a/docs/models/operations/getmtlsauthwithconsumerresponse.md b/docs/models/operations/getmtlsauthwithconsumerresponse.md new file mode 100644 index 0000000..42c9712 --- /dev/null +++ b/docs/models/operations/getmtlsauthwithconsumerresponse.md @@ -0,0 +1,11 @@ +# GetMtlsAuthWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `MTLSAuth` | [*components.MTLSAuth](../../models/components/mtlsauth.md) | :heavy_minus_sign: | Successfully fetched MTLS-auth credential | {
"ca_certificate": {
"id": "b2f34145-0343-41a4-9602-4c69dec2f260"
},
"consumer": {
"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"
},
"id": "b2f34145-0343-41a4-9602-4c69dec2f269",
"subject_name": "CA_Subject_Name"
} | \ No newline at end of file diff --git a/docs/models/operations/getpluginwithconsumergrouprequest.md b/docs/models/operations/getpluginwithconsumergrouprequest.md new file mode 100644 index 0000000..551958b --- /dev/null +++ b/docs/models/operations/getpluginwithconsumergrouprequest.md @@ -0,0 +1,10 @@ +# GetPluginWithConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | ID of the Consumer Group to lookup | | +| `PluginID` | *string* | :heavy_check_mark: | ID of the Plugin to lookup | 3473c251-5b6c-4f45-b1ff-7ede735a366d | \ No newline at end of file diff --git a/docs/models/operations/getpluginwithconsumergroupresponse.md b/docs/models/operations/getpluginwithconsumergroupresponse.md new file mode 100644 index 0000000..a804b1c --- /dev/null +++ b/docs/models/operations/getpluginwithconsumergroupresponse.md @@ -0,0 +1,11 @@ +# GetPluginWithConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Plugin` | [*components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | Successfully fetched Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/getpluginwithconsumerrequest.md b/docs/models/operations/getpluginwithconsumerrequest.md new file mode 100644 index 0000000..3b776e3 --- /dev/null +++ b/docs/models/operations/getpluginwithconsumerrequest.md @@ -0,0 +1,10 @@ +# GetPluginWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `PluginID` | *string* | :heavy_check_mark: | ID of the Plugin to lookup | 3473c251-5b6c-4f45-b1ff-7ede735a366d | \ No newline at end of file diff --git a/docs/models/operations/getpluginwithconsumerresponse.md b/docs/models/operations/getpluginwithconsumerresponse.md new file mode 100644 index 0000000..4909f33 --- /dev/null +++ b/docs/models/operations/getpluginwithconsumerresponse.md @@ -0,0 +1,11 @@ +# GetPluginWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Plugin` | [*components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | Successfully fetched Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/listconsumergroupsforconsumerrequest.md b/docs/models/operations/listconsumergroupsforconsumerrequest.md index 59721cc..78ad1f7 100644 --- a/docs/models/operations/listconsumergroupsforconsumerrequest.md +++ b/docs/models/operations/listconsumergroupsforconsumerrequest.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | -| `ConsumerID` | *string* | :heavy_check_mark: | ID of the Consumer to lookup | c1059869-6fa7-4329-a5f5-5946d14ca2c5 | +| `ConsumerID` | *string* | :heavy_check_mark: | The UUID of the consumer. | 123e4567-e89b-12d3-a456-426614174000 | | `Size` | **int64* | :heavy_minus_sign: | Number of resources to be returned. | | | `Offset` | **string* | :heavy_minus_sign: | Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources | | | `Tags` | **string* | :heavy_minus_sign: | A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. | tag1,tag2 | \ No newline at end of file diff --git a/docs/models/operations/listconsumersforconsumergrouprequest.md b/docs/models/operations/listconsumersforconsumergrouprequest.md new file mode 100644 index 0000000..2da5b64 --- /dev/null +++ b/docs/models/operations/listconsumersforconsumergrouprequest.md @@ -0,0 +1,12 @@ +# ListConsumersForConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | N/A | | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `Size` | **int64* | :heavy_minus_sign: | Number of resources to be returned. | | +| `Offset` | **string* | :heavy_minus_sign: | Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources | | +| `Tags` | **string* | :heavy_minus_sign: | A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. | tag1,tag2 | \ No newline at end of file diff --git a/docs/models/operations/listconsumersforconsumergroupresponse.md b/docs/models/operations/listconsumersforconsumergroupresponse.md new file mode 100644 index 0000000..3e92e4a --- /dev/null +++ b/docs/models/operations/listconsumersforconsumergroupresponse.md @@ -0,0 +1,11 @@ +# ListConsumersForConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.ListConsumersForConsumerGroupResponseBody](../../models/operations/listconsumersforconsumergroupresponsebody.md) | :heavy_minus_sign: | A successful response listing of consumers | \ No newline at end of file diff --git a/docs/models/operations/listconsumersforconsumergroupresponsebody.md b/docs/models/operations/listconsumersforconsumergroupresponsebody.md new file mode 100644 index 0000000..f4adc45 --- /dev/null +++ b/docs/models/operations/listconsumersforconsumergroupresponsebody.md @@ -0,0 +1,12 @@ +# ListConsumersForConsumerGroupResponseBody + +A successful response listing of consumers + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.Consumer](../../models/components/consumer.md) | :heavy_minus_sign: | N/A | +| `Next` | **string* | :heavy_minus_sign: | URI to the next page (may be null) | +| `Offset` | **string* | :heavy_minus_sign: | Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page | \ No newline at end of file diff --git a/docs/models/operations/listmtlsauthrequest.md b/docs/models/operations/listmtlsauthrequest.md new file mode 100644 index 0000000..8d2cc63 --- /dev/null +++ b/docs/models/operations/listmtlsauthrequest.md @@ -0,0 +1,11 @@ +# ListMtlsAuthRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `Size` | **int64* | :heavy_minus_sign: | Number of resources to be returned. | | +| `Offset` | **string* | :heavy_minus_sign: | Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources | | +| `Tags` | **string* | :heavy_minus_sign: | A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. | tag1,tag2 | \ No newline at end of file diff --git a/docs/models/operations/listmtlsauthresponse.md b/docs/models/operations/listmtlsauthresponse.md new file mode 100644 index 0000000..529bd50 --- /dev/null +++ b/docs/models/operations/listmtlsauthresponse.md @@ -0,0 +1,11 @@ +# ListMtlsAuthResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.ListMtlsAuthResponseBody](../../models/operations/listmtlsauthresponsebody.md) | :heavy_minus_sign: | A successful response listing MTLS-auth credentials | \ No newline at end of file diff --git a/docs/models/operations/listmtlsauthresponsebody.md b/docs/models/operations/listmtlsauthresponsebody.md new file mode 100644 index 0000000..071ee2d --- /dev/null +++ b/docs/models/operations/listmtlsauthresponsebody.md @@ -0,0 +1,12 @@ +# ListMtlsAuthResponseBody + +A successful response listing MTLS-auth credentials + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.MTLSAuth](../../models/components/mtlsauth.md) | :heavy_minus_sign: | N/A | +| `Next` | **string* | :heavy_minus_sign: | URI to the next page (may be null) | +| `Offset` | **string* | :heavy_minus_sign: | Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page | \ No newline at end of file diff --git a/docs/models/operations/listmtlsauthwithconsumerrequest.md b/docs/models/operations/listmtlsauthwithconsumerrequest.md new file mode 100644 index 0000000..5557efc --- /dev/null +++ b/docs/models/operations/listmtlsauthwithconsumerrequest.md @@ -0,0 +1,12 @@ +# ListMtlsAuthWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `Size` | **int64* | :heavy_minus_sign: | Number of resources to be returned. | | +| `Offset` | **string* | :heavy_minus_sign: | Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources | | +| `Tags` | **string* | :heavy_minus_sign: | A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. | tag1,tag2 | \ No newline at end of file diff --git a/docs/models/operations/listmtlsauthwithconsumerresponse.md b/docs/models/operations/listmtlsauthwithconsumerresponse.md new file mode 100644 index 0000000..c1a0073 --- /dev/null +++ b/docs/models/operations/listmtlsauthwithconsumerresponse.md @@ -0,0 +1,11 @@ +# ListMtlsAuthWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.ListMtlsAuthWithConsumerResponseBody](../../models/operations/listmtlsauthwithconsumerresponsebody.md) | :heavy_minus_sign: | A successful response listing MTLS-auth credentials | \ No newline at end of file diff --git a/docs/models/operations/listmtlsauthwithconsumerresponsebody.md b/docs/models/operations/listmtlsauthwithconsumerresponsebody.md new file mode 100644 index 0000000..1c14e3c --- /dev/null +++ b/docs/models/operations/listmtlsauthwithconsumerresponsebody.md @@ -0,0 +1,12 @@ +# ListMtlsAuthWithConsumerResponseBody + +A successful response listing MTLS-auth credentials + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.MTLSAuth](../../models/components/mtlsauth.md) | :heavy_minus_sign: | N/A | +| `Next` | **string* | :heavy_minus_sign: | URI to the next page (may be null) | +| `Offset` | **string* | :heavy_minus_sign: | Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page | \ No newline at end of file diff --git a/docs/models/operations/listpluginwithconsumergrouprequest.md b/docs/models/operations/listpluginwithconsumergrouprequest.md new file mode 100644 index 0000000..09236c3 --- /dev/null +++ b/docs/models/operations/listpluginwithconsumergrouprequest.md @@ -0,0 +1,12 @@ +# ListPluginWithConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | ID of the Consumer Group to lookup | | +| `Size` | **int64* | :heavy_minus_sign: | Number of resources to be returned. | | +| `Offset` | **string* | :heavy_minus_sign: | Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources | | +| `Tags` | **string* | :heavy_minus_sign: | A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. | tag1,tag2 | \ No newline at end of file diff --git a/docs/models/operations/listpluginwithconsumergroupresponse.md b/docs/models/operations/listpluginwithconsumergroupresponse.md new file mode 100644 index 0000000..2007ad1 --- /dev/null +++ b/docs/models/operations/listpluginwithconsumergroupresponse.md @@ -0,0 +1,11 @@ +# ListPluginWithConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.ListPluginWithConsumerGroupResponseBody](../../models/operations/listpluginwithconsumergroupresponsebody.md) | :heavy_minus_sign: | A successful response listing Plugins | \ No newline at end of file diff --git a/docs/models/operations/listpluginwithconsumergroupresponsebody.md b/docs/models/operations/listpluginwithconsumergroupresponsebody.md new file mode 100644 index 0000000..866d390 --- /dev/null +++ b/docs/models/operations/listpluginwithconsumergroupresponsebody.md @@ -0,0 +1,12 @@ +# ListPluginWithConsumerGroupResponseBody + +A successful response listing Plugins + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | N/A | +| `Next` | **string* | :heavy_minus_sign: | URI to the next page (may be null) | +| `Offset` | **string* | :heavy_minus_sign: | Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page | \ No newline at end of file diff --git a/docs/models/operations/listpluginwithconsumerrequest.md b/docs/models/operations/listpluginwithconsumerrequest.md new file mode 100644 index 0000000..2a366aa --- /dev/null +++ b/docs/models/operations/listpluginwithconsumerrequest.md @@ -0,0 +1,12 @@ +# ListPluginWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `Size` | **int64* | :heavy_minus_sign: | Number of resources to be returned. | | +| `Offset` | **string* | :heavy_minus_sign: | Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources | | +| `Tags` | **string* | :heavy_minus_sign: | A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. | tag1,tag2 | \ No newline at end of file diff --git a/docs/models/operations/listpluginwithconsumerresponse.md b/docs/models/operations/listpluginwithconsumerresponse.md new file mode 100644 index 0000000..423aeb9 --- /dev/null +++ b/docs/models/operations/listpluginwithconsumerresponse.md @@ -0,0 +1,11 @@ +# ListPluginWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.ListPluginWithConsumerResponseBody](../../models/operations/listpluginwithconsumerresponsebody.md) | :heavy_minus_sign: | A successful response listing Plugins | \ No newline at end of file diff --git a/docs/models/operations/listpluginwithconsumerresponsebody.md b/docs/models/operations/listpluginwithconsumerresponsebody.md new file mode 100644 index 0000000..01adab2 --- /dev/null +++ b/docs/models/operations/listpluginwithconsumerresponsebody.md @@ -0,0 +1,12 @@ +# ListPluginWithConsumerResponseBody + +A successful response listing Plugins + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `Data` | [][components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | N/A | +| `Next` | **string* | :heavy_minus_sign: | URI to the next page (may be null) | +| `Offset` | **string* | :heavy_minus_sign: | Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page | \ No newline at end of file diff --git a/docs/models/operations/removeconsumerfromconsumergrouprequest.md b/docs/models/operations/removeconsumerfromconsumergrouprequest.md new file mode 100644 index 0000000..32d7d41 --- /dev/null +++ b/docs/models/operations/removeconsumerfromconsumergrouprequest.md @@ -0,0 +1,10 @@ +# RemoveConsumerFromConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerID` | *string* | :heavy_check_mark: | The UUID of the consumer. | 123e4567-e89b-12d3-a456-426614174000 | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | ID of the Consumer Group to lookup | | \ No newline at end of file diff --git a/docs/models/operations/removeconsumerfromconsumergroupresponse.md b/docs/models/operations/removeconsumerfromconsumergroupresponse.md new file mode 100644 index 0000000..83fba68 --- /dev/null +++ b/docs/models/operations/removeconsumerfromconsumergroupresponse.md @@ -0,0 +1,10 @@ +# RemoveConsumerFromConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/upsertconsumerrequest.md b/docs/models/operations/upsertconsumerrequest.md index 1c92ccb..fd3ed5b 100644 --- a/docs/models/operations/upsertconsumerrequest.md +++ b/docs/models/operations/upsertconsumerrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `ConsumerID` | *string* | :heavy_check_mark: | ID of the Consumer to lookup | c1059869-6fa7-4329-a5f5-5946d14ca2c5 | +| `ConsumerID` | *string* | :heavy_check_mark: | The UUID of the consumer. | 123e4567-e89b-12d3-a456-426614174000 | | `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | | `Consumer` | [components.ConsumerInput](../../models/components/consumerinput.md) | :heavy_check_mark: | Description of the Consumer | {
"custom_id": "4200",
"id": "8a388226-80e8-4027-a486-25e4f7db5d21",
"tags": [
"silver-tier"
],
"username": "bob-the-builder"
} | \ No newline at end of file diff --git a/docs/models/operations/upsertmtlsauthwithconsumerrequest.md b/docs/models/operations/upsertmtlsauthwithconsumerrequest.md new file mode 100644 index 0000000..7cbe247 --- /dev/null +++ b/docs/models/operations/upsertmtlsauthwithconsumerrequest.md @@ -0,0 +1,11 @@ +# UpsertMtlsAuthWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `MTLSAuthID` | *string* | :heavy_check_mark: | ID of the MTLS-auth credential to lookup | | +| `MTLSAuthWithoutParents` | [components.MTLSAuthWithoutParents](../../models/components/mtlsauthwithoutparents.md) | :heavy_check_mark: | Description of the MTLS-auth credential | {
"ca_certificate": {
"id": "b2f34145-0343-41a4-9602-4c69dec2f260"
},
"id": "b2f34145-0343-41a4-9602-4c69dec2f269",
"subject_name": "CA_Subject_Name"
} | \ No newline at end of file diff --git a/docs/models/operations/upsertmtlsauthwithconsumerresponse.md b/docs/models/operations/upsertmtlsauthwithconsumerresponse.md new file mode 100644 index 0000000..43fd70b --- /dev/null +++ b/docs/models/operations/upsertmtlsauthwithconsumerresponse.md @@ -0,0 +1,11 @@ +# UpsertMtlsAuthWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `MTLSAuth` | [*components.MTLSAuth](../../models/components/mtlsauth.md) | :heavy_minus_sign: | Successfully upserted MTLS-auth credential | {
"ca_certificate": {
"id": "b2f34145-0343-41a4-9602-4c69dec2f260"
},
"consumer": {
"id": "84a73fb8-50fc-44a7-a4d5-aa17728ee83f"
},
"id": "b2f34145-0343-41a4-9602-4c69dec2f269",
"subject_name": "CA_Subject_Name"
} | \ No newline at end of file diff --git a/docs/models/operations/upsertpluginwithconsumergrouprequest.md b/docs/models/operations/upsertpluginwithconsumergrouprequest.md new file mode 100644 index 0000000..b640949 --- /dev/null +++ b/docs/models/operations/upsertpluginwithconsumergrouprequest.md @@ -0,0 +1,11 @@ +# UpsertPluginWithConsumerGroupRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerGroupID` | *string* | :heavy_check_mark: | ID of the Consumer Group to lookup | | +| `PluginID` | *string* | :heavy_check_mark: | ID of the Plugin to lookup | 3473c251-5b6c-4f45-b1ff-7ede735a366d | +| `PluginWithoutParents` | [components.PluginWithoutParents](../../models/components/pluginwithoutparents.md) | :heavy_check_mark: | Description of the Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/upsertpluginwithconsumergroupresponse.md b/docs/models/operations/upsertpluginwithconsumergroupresponse.md new file mode 100644 index 0000000..e0acafc --- /dev/null +++ b/docs/models/operations/upsertpluginwithconsumergroupresponse.md @@ -0,0 +1,11 @@ +# UpsertPluginWithConsumerGroupResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Plugin` | [*components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | Successfully upserted Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/upsertpluginwithconsumerrequest.md b/docs/models/operations/upsertpluginwithconsumerrequest.md new file mode 100644 index 0000000..6fe8072 --- /dev/null +++ b/docs/models/operations/upsertpluginwithconsumerrequest.md @@ -0,0 +1,11 @@ +# UpsertPluginWithConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ControlPlaneID` | *string* | :heavy_check_mark: | The UUID of your control plane. This variable is available in the Konnect manager. | 9524ec7d-36d9-465d-a8c5-83a3c9390458 | +| `ConsumerIDForNestedEntities` | *string* | :heavy_check_mark: | Consumer ID for nested entities | f28acbfa-c866-4587-b688-0208ac24df21 | +| `PluginID` | *string* | :heavy_check_mark: | ID of the Plugin to lookup | 3473c251-5b6c-4f45-b1ff-7ede735a366d | +| `PluginWithoutParents` | [components.PluginWithoutParents](../../models/components/pluginwithoutparents.md) | :heavy_check_mark: | Description of the Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/docs/models/operations/upsertpluginwithconsumerresponse.md b/docs/models/operations/upsertpluginwithconsumerresponse.md new file mode 100644 index 0000000..089771d --- /dev/null +++ b/docs/models/operations/upsertpluginwithconsumerresponse.md @@ -0,0 +1,11 @@ +# UpsertPluginWithConsumerResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `Plugin` | [*components.Plugin](../../models/components/plugin.md) | :heavy_minus_sign: | Successfully upserted Plugin | {
"config": {
"anonymous": null,
"hide_credentials": false,
"key_in_body": false,
"key_in_header": true,
"key_in_query": true,
"key_names": [
"apikey"
],
"run_on_preflight": true
},
"enabled": true,
"id": "3fd1eea1-885a-4011-b986-289943ff8177",
"name": "key-auth",
"protocols": [
"grpc",
"grpcs",
"http",
"https"
]
} | \ No newline at end of file diff --git a/dpnodes.go b/dpnodes.go index 807ac2e..2d15258 100644 --- a/dpnodes.go +++ b/dpnodes.go @@ -180,12 +180,12 @@ func (s *DPNodes) GetExpectedConfigHash(ctx context.Context, controlPlaneID stri return nil, err } - var out components.GetExpectedConfigHash + var out components.GetExpectedConfigHashResponse if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.GetExpectedConfigHash = &out + res.GetExpectedConfigHashResponse = &out default: rawBody, err := utils.ConsumeRawBody(httpRes) if err != nil { diff --git a/models/components/acl.go b/models/components/acl.go index fbc11d8..1745346 100644 --- a/models/components/acl.go +++ b/models/components/acl.go @@ -17,7 +17,7 @@ type ACL struct { Consumer *ACLConsumer `json:"consumer,omitempty"` // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` - Group *string `json:"group,omitempty"` + Group string `json:"group"` ID *string `json:"id,omitempty"` Tags []string `json:"tags,omitempty"` } @@ -36,9 +36,9 @@ func (o *ACL) GetCreatedAt() *int64 { return o.CreatedAt } -func (o *ACL) GetGroup() *string { +func (o *ACL) GetGroup() string { if o == nil { - return nil + return "" } return o.Group } diff --git a/models/components/aclwithoutparents.go b/models/components/aclwithoutparents.go index 1dfaf56..ccf9022 100644 --- a/models/components/aclwithoutparents.go +++ b/models/components/aclwithoutparents.go @@ -3,14 +3,14 @@ package components type ACLWithoutParents struct { - Group *string `json:"group,omitempty"` + Group string `json:"group"` ID *string `json:"id,omitempty"` Tags []string `json:"tags,omitempty"` } -func (o *ACLWithoutParents) GetGroup() *string { +func (o *ACLWithoutParents) GetGroup() string { if o == nil { - return nil + return "" } return o.Group } diff --git a/models/components/basicauth.go b/models/components/basicauth.go index 8dee124..651469e 100644 --- a/models/components/basicauth.go +++ b/models/components/basicauth.go @@ -18,9 +18,9 @@ type BasicAuth struct { // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` ID *string `json:"id,omitempty"` - Password *string `json:"password,omitempty"` + Password string `json:"password"` Tags []string `json:"tags,omitempty"` - Username *string `json:"username,omitempty"` + Username string `json:"username"` } func (o *BasicAuth) GetConsumer() *BasicAuthConsumer { @@ -44,9 +44,9 @@ func (o *BasicAuth) GetID() *string { return o.ID } -func (o *BasicAuth) GetPassword() *string { +func (o *BasicAuth) GetPassword() string { if o == nil { - return nil + return "" } return o.Password } @@ -58,9 +58,9 @@ func (o *BasicAuth) GetTags() []string { return o.Tags } -func (o *BasicAuth) GetUsername() *string { +func (o *BasicAuth) GetUsername() string { if o == nil { - return nil + return "" } return o.Username } diff --git a/models/components/basicauthwithoutparents.go b/models/components/basicauthwithoutparents.go index 8c69e60..275b50b 100644 --- a/models/components/basicauthwithoutparents.go +++ b/models/components/basicauthwithoutparents.go @@ -4,9 +4,9 @@ package components type BasicAuthWithoutParents struct { ID *string `json:"id,omitempty"` - Password *string `json:"password,omitempty"` + Password string `json:"password"` Tags []string `json:"tags,omitempty"` - Username *string `json:"username,omitempty"` + Username string `json:"username"` } func (o *BasicAuthWithoutParents) GetID() *string { @@ -16,9 +16,9 @@ func (o *BasicAuthWithoutParents) GetID() *string { return o.ID } -func (o *BasicAuthWithoutParents) GetPassword() *string { +func (o *BasicAuthWithoutParents) GetPassword() string { if o == nil { - return nil + return "" } return o.Password } @@ -30,9 +30,9 @@ func (o *BasicAuthWithoutParents) GetTags() []string { return o.Tags } -func (o *BasicAuthWithoutParents) GetUsername() *string { +func (o *BasicAuthWithoutParents) GetUsername() string { if o == nil { - return nil + return "" } return o.Username } diff --git a/models/components/certificate.go b/models/components/certificate.go index 1a5b434..b73d389 100644 --- a/models/components/certificate.go +++ b/models/components/certificate.go @@ -14,7 +14,8 @@ type Certificate struct { // PEM-encoded private key of the SSL key pair. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). Key string `json:"key"` // PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). - KeyAlt *string `json:"key_alt,omitempty"` + KeyAlt *string `json:"key_alt,omitempty"` + Snis []string `json:"snis,omitempty"` // An optional set of strings associated with the Certificate for grouping and filtering. Tags []string `json:"tags,omitempty"` // Unix epoch when the resource was last updated. @@ -63,6 +64,13 @@ func (o *Certificate) GetKeyAlt() *string { return o.KeyAlt } +func (o *Certificate) GetSnis() []string { + if o == nil { + return nil + } + return o.Snis +} + func (o *Certificate) GetTags() []string { if o == nil { return nil diff --git a/models/components/certificateinput.go b/models/components/certificateinput.go index 0e6c16f..3fdc8dc 100644 --- a/models/components/certificateinput.go +++ b/models/components/certificateinput.go @@ -12,7 +12,8 @@ type CertificateInput struct { // PEM-encoded private key of the SSL key pair. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). Key string `json:"key"` // PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is _referenceable_, which means it can be securely stored as a [secret](/gateway/latest/plan-and-deploy/security/secrets-management/getting-started) in a vault. References must follow a [specific format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). - KeyAlt *string `json:"key_alt,omitempty"` + KeyAlt *string `json:"key_alt,omitempty"` + Snis []string `json:"snis,omitempty"` // An optional set of strings associated with the Certificate for grouping and filtering. Tags []string `json:"tags,omitempty"` } @@ -52,6 +53,13 @@ func (o *CertificateInput) GetKeyAlt() *string { return o.KeyAlt } +func (o *CertificateInput) GetSnis() []string { + if o == nil { + return nil + } + return o.Snis +} + func (o *CertificateInput) GetTags() []string { if o == nil { return nil diff --git a/models/components/controlplane.go b/models/components/controlplane.go index 277d9be..f0223ed 100644 --- a/models/components/controlplane.go +++ b/models/components/controlplane.go @@ -14,7 +14,6 @@ type ControlPlaneClusterType string const ( ControlPlaneClusterTypeClusterTypeControlPlane ControlPlaneClusterType = "CLUSTER_TYPE_CONTROL_PLANE" - ControlPlaneClusterTypeClusterTypeHybrid ControlPlaneClusterType = "CLUSTER_TYPE_HYBRID" ControlPlaneClusterTypeClusterTypeK8SIngressController ControlPlaneClusterType = "CLUSTER_TYPE_K8S_INGRESS_CONTROLLER" ControlPlaneClusterTypeClusterTypeControlPlaneGroup ControlPlaneClusterType = "CLUSTER_TYPE_CONTROL_PLANE_GROUP" ControlPlaneClusterTypeClusterTypeServerless ControlPlaneClusterType = "CLUSTER_TYPE_SERVERLESS" @@ -31,8 +30,6 @@ func (e *ControlPlaneClusterType) UnmarshalJSON(data []byte) error { switch v { case "CLUSTER_TYPE_CONTROL_PLANE": fallthrough - case "CLUSTER_TYPE_HYBRID": - fallthrough case "CLUSTER_TYPE_K8S_INGRESS_CONTROLLER": fallthrough case "CLUSTER_TYPE_CONTROL_PLANE_GROUP": diff --git a/models/components/getexpectedconfighash.go b/models/components/getexpectedconfighash.go deleted file mode 100644 index 805f714..0000000 --- a/models/components/getexpectedconfighash.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - -package components - -// GetExpectedConfigHash - Response body for retrieving the expected config hash of the control plane. -type GetExpectedConfigHash struct { - // The expected configuration hash. - ExpectedHash *string `json:"expected_hash,omitempty"` - // Date the control plane configuration was created. - CreatedAt *int64 `json:"created_at,omitempty"` - // Date the control plane configuration was last updated. - UpdatedAt *int64 `json:"updated_at,omitempty"` -} - -func (o *GetExpectedConfigHash) GetExpectedHash() *string { - if o == nil { - return nil - } - return o.ExpectedHash -} - -func (o *GetExpectedConfigHash) GetCreatedAt() *int64 { - if o == nil { - return nil - } - return o.CreatedAt -} - -func (o *GetExpectedConfigHash) GetUpdatedAt() *int64 { - if o == nil { - return nil - } - return o.UpdatedAt -} diff --git a/models/components/getexpectedconfighashresponse.go b/models/components/getexpectedconfighashresponse.go new file mode 100644 index 0000000..05e506a --- /dev/null +++ b/models/components/getexpectedconfighashresponse.go @@ -0,0 +1,34 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +// GetExpectedConfigHashResponse - Response body for retrieving the expected config hash of the control plane. +type GetExpectedConfigHashResponse struct { + // The expected configuration hash. + ExpectedHash string `json:"expected_hash"` + // Date the control plane configuration was created. + CreatedAt int64 `json:"created_at"` + // Date the control plane configuration was last updated. + UpdatedAt int64 `json:"updated_at"` +} + +func (o *GetExpectedConfigHashResponse) GetExpectedHash() string { + if o == nil { + return "" + } + return o.ExpectedHash +} + +func (o *GetExpectedConfigHashResponse) GetCreatedAt() int64 { + if o == nil { + return 0 + } + return o.CreatedAt +} + +func (o *GetExpectedConfigHashResponse) GetUpdatedAt() int64 { + if o == nil { + return 0 + } + return o.UpdatedAt +} diff --git a/models/components/groupconflict.go b/models/components/groupconflict.go index 3451895..68b9992 100644 --- a/models/components/groupconflict.go +++ b/models/components/groupconflict.go @@ -5,30 +5,30 @@ package components // GroupConflict - The Group Conflict object contains information about a conflict in a control plane group. type GroupConflict struct { // The ID of a control plane member of a control plane group. - ClusterID *string `json:"cluster_id,omitempty"` + ClusterID string `json:"cluster_id"` // The description of the conflict. - Description *string `json:"description,omitempty"` + Description string `json:"description"` // A resource causing a conflict in a control plane group. - Resource *GroupConflictResource `json:"resource,omitempty"` + Resource GroupConflictResource `json:"resource"` } -func (o *GroupConflict) GetClusterID() *string { +func (o *GroupConflict) GetClusterID() string { if o == nil { - return nil + return "" } return o.ClusterID } -func (o *GroupConflict) GetDescription() *string { +func (o *GroupConflict) GetDescription() string { if o == nil { - return nil + return "" } return o.Description } -func (o *GroupConflict) GetResource() *GroupConflictResource { +func (o *GroupConflict) GetResource() GroupConflictResource { if o == nil { - return nil + return GroupConflictResource{} } return o.Resource } diff --git a/models/components/groupmembership.go b/models/components/groupmembership.go index 0cdc70c..c0ce22f 100644 --- a/models/components/groupmembership.go +++ b/models/components/groupmembership.go @@ -3,12 +3,12 @@ package components type Members struct { - ID *string `json:"id,omitempty"` + ID string `json:"id"` } -func (o *Members) GetID() *string { +func (o *Members) GetID() string { if o == nil { - return nil + return "" } return o.ID } @@ -20,7 +20,7 @@ type GroupMembership struct { func (o *GroupMembership) GetMembers() []Members { if o == nil { - return nil + return []Members{} } return o.Members } diff --git a/models/components/groupstatus.go b/models/components/groupstatus.go index dc63f4c..b27648e 100644 --- a/models/components/groupstatus.go +++ b/models/components/groupstatus.go @@ -42,14 +42,14 @@ func (e *State) UnmarshalJSON(data []byte) error { // GroupStatus - The Group Status object contains information about the status of a control plane group. type GroupStatus struct { // The control plane group ID. - ID *string `json:"id,omitempty"` + ID string `json:"id"` // An ISO-8604 timestamp representation of control plane group status creation date. - CreatedAt *time.Time `json:"created_at,omitempty"` + CreatedAt time.Time `json:"created_at"` // An ISO-8604 timestamp representation of control plane group status update date. - UpdatedAt *time.Time `json:"updated_at,omitempty"` + UpdatedAt time.Time `json:"updated_at"` Conflicts []GroupConflict `json:"conflicts,omitempty"` // The state of the control plane group. - State *State `json:"state,omitempty"` + State State `json:"state"` } func (g GroupStatus) MarshalJSON() ([]byte, error) { @@ -63,23 +63,23 @@ func (g *GroupStatus) UnmarshalJSON(data []byte) error { return nil } -func (o *GroupStatus) GetID() *string { +func (o *GroupStatus) GetID() string { if o == nil { - return nil + return "" } return o.ID } -func (o *GroupStatus) GetCreatedAt() *time.Time { +func (o *GroupStatus) GetCreatedAt() time.Time { if o == nil { - return nil + return time.Time{} } return o.CreatedAt } -func (o *GroupStatus) GetUpdatedAt() *time.Time { +func (o *GroupStatus) GetUpdatedAt() time.Time { if o == nil { - return nil + return time.Time{} } return o.UpdatedAt } @@ -91,9 +91,9 @@ func (o *GroupStatus) GetConflicts() []GroupConflict { return o.Conflicts } -func (o *GroupStatus) GetState() *State { +func (o *GroupStatus) GetState() State { if o == nil { - return nil + return State("") } return o.State } diff --git a/models/components/hmacauth.go b/models/components/hmacauth.go index ed26f24..8ce7d76 100644 --- a/models/components/hmacauth.go +++ b/models/components/hmacauth.go @@ -20,7 +20,7 @@ type HMACAuth struct { ID *string `json:"id,omitempty"` Secret *string `json:"secret,omitempty"` Tags []string `json:"tags,omitempty"` - Username *string `json:"username,omitempty"` + Username string `json:"username"` } func (o *HMACAuth) GetConsumer() *HMACAuthConsumer { @@ -58,9 +58,9 @@ func (o *HMACAuth) GetTags() []string { return o.Tags } -func (o *HMACAuth) GetUsername() *string { +func (o *HMACAuth) GetUsername() string { if o == nil { - return nil + return "" } return o.Username } diff --git a/models/components/hmacauthwithoutparents.go b/models/components/hmacauthwithoutparents.go index 94755cb..abb7187 100644 --- a/models/components/hmacauthwithoutparents.go +++ b/models/components/hmacauthwithoutparents.go @@ -6,7 +6,7 @@ type HMACAuthWithoutParents struct { ID *string `json:"id,omitempty"` Secret *string `json:"secret,omitempty"` Tags []string `json:"tags,omitempty"` - Username *string `json:"username,omitempty"` + Username string `json:"username"` } func (o *HMACAuthWithoutParents) GetID() *string { @@ -30,9 +30,9 @@ func (o *HMACAuthWithoutParents) GetTags() []string { return o.Tags } -func (o *HMACAuthWithoutParents) GetUsername() *string { +func (o *HMACAuthWithoutParents) GetUsername() string { if o == nil { - return nil + return "" } return o.Username } diff --git a/models/components/idp.go b/models/components/idp.go index 89133e2..79510a2 100644 --- a/models/components/idp.go +++ b/models/components/idp.go @@ -2,25 +2,10 @@ package components -import ( - "github.com/Kong/sdk-konnect-go/internal/utils" -) - type ClaimMappings struct { - Name *string `default:"name" json:"name"` - Email *string `default:"email" json:"email"` - Groups *string `default:"groups" json:"groups"` -} - -func (c ClaimMappings) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(c, "", false) -} - -func (c *ClaimMappings) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &c, "", false, false); err != nil { - return err - } - return nil + Name *string `json:"name,omitempty"` + Email *string `json:"email,omitempty"` + Groups *string `json:"groups,omitempty"` } func (o *ClaimMappings) GetName() *string { diff --git a/models/components/invalidparametermaximumlength.go b/models/components/invalidparametermaximumlength.go new file mode 100644 index 0000000..ebf8162 --- /dev/null +++ b/models/components/invalidparametermaximumlength.go @@ -0,0 +1,82 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +import ( + "encoding/json" + "fmt" +) + +// InvalidParameterMaximumLengthRule - invalid parameters rules +type InvalidParameterMaximumLengthRule string + +const ( + InvalidParameterMaximumLengthRuleMaxLength InvalidParameterMaximumLengthRule = "max_length" + InvalidParameterMaximumLengthRuleMaxItems InvalidParameterMaximumLengthRule = "max_items" + InvalidParameterMaximumLengthRuleMax InvalidParameterMaximumLengthRule = "max" +) + +func (e InvalidParameterMaximumLengthRule) ToPointer() *InvalidParameterMaximumLengthRule { + return &e +} +func (e *InvalidParameterMaximumLengthRule) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "max_length": + fallthrough + case "max_items": + fallthrough + case "max": + *e = InvalidParameterMaximumLengthRule(v) + return nil + default: + return fmt.Errorf("invalid value for InvalidParameterMaximumLengthRule: %v", v) + } +} + +type InvalidParameterMaximumLength struct { + Field string `json:"field"` + // invalid parameters rules + Rule InvalidParameterMaximumLengthRule `json:"rule"` + Maximum int64 `json:"maximum"` + Source *string `json:"source,omitempty"` + Reason string `json:"reason"` +} + +func (o *InvalidParameterMaximumLength) GetField() string { + if o == nil { + return "" + } + return o.Field +} + +func (o *InvalidParameterMaximumLength) GetRule() InvalidParameterMaximumLengthRule { + if o == nil { + return InvalidParameterMaximumLengthRule("") + } + return o.Rule +} + +func (o *InvalidParameterMaximumLength) GetMaximum() int64 { + if o == nil { + return 0 + } + return o.Maximum +} + +func (o *InvalidParameterMaximumLength) GetSource() *string { + if o == nil { + return nil + } + return o.Source +} + +func (o *InvalidParameterMaximumLength) GetReason() string { + if o == nil { + return "" + } + return o.Reason +} diff --git a/models/components/invalidparameterminimumlength.go b/models/components/invalidparameterminimumlength.go index 172707c..c034a6d 100644 --- a/models/components/invalidparameterminimumlength.go +++ b/models/components/invalidparameterminimumlength.go @@ -16,6 +16,8 @@ const ( RuleMinLowercase Rule = "min_lowercase" RuleMinUppercase Rule = "min_uppercase" RuleMinSymbols Rule = "min_symbols" + RuleMinItems Rule = "min_items" + RuleMin Rule = "min" ) func (e Rule) ToPointer() *Rule { @@ -36,6 +38,10 @@ func (e *Rule) UnmarshalJSON(data []byte) error { case "min_uppercase": fallthrough case "min_symbols": + fallthrough + case "min_items": + fallthrough + case "min": *e = Rule(v) return nil default: diff --git a/models/components/invalidparameters.go b/models/components/invalidparameters.go index efc03d4..f4af4f0 100644 --- a/models/components/invalidparameters.go +++ b/models/components/invalidparameters.go @@ -13,6 +13,7 @@ type InvalidParametersType string const ( InvalidParametersTypeInvalidParameterStandard InvalidParametersType = "InvalidParameterStandard" InvalidParametersTypeInvalidParameterMinimumLength InvalidParametersType = "InvalidParameterMinimumLength" + InvalidParametersTypeInvalidParameterMaximumLength InvalidParametersType = "InvalidParameterMaximumLength" InvalidParametersTypeInvalidParameterChoiceItem InvalidParametersType = "InvalidParameterChoiceItem" InvalidParametersTypeInvalidParameterDependentItem InvalidParametersType = "InvalidParameterDependentItem" ) @@ -20,6 +21,7 @@ const ( type InvalidParameters struct { InvalidParameterStandard *InvalidParameterStandard InvalidParameterMinimumLength *InvalidParameterMinimumLength + InvalidParameterMaximumLength *InvalidParameterMaximumLength InvalidParameterChoiceItem *InvalidParameterChoiceItem InvalidParameterDependentItem *InvalidParameterDependentItem @@ -44,6 +46,15 @@ func CreateInvalidParametersInvalidParameterMinimumLength(invalidParameterMinimu } } +func CreateInvalidParametersInvalidParameterMaximumLength(invalidParameterMaximumLength InvalidParameterMaximumLength) InvalidParameters { + typ := InvalidParametersTypeInvalidParameterMaximumLength + + return InvalidParameters{ + InvalidParameterMaximumLength: &invalidParameterMaximumLength, + Type: typ, + } +} + func CreateInvalidParametersInvalidParameterChoiceItem(invalidParameterChoiceItem InvalidParameterChoiceItem) InvalidParameters { typ := InvalidParametersTypeInvalidParameterChoiceItem @@ -78,6 +89,13 @@ func (u *InvalidParameters) UnmarshalJSON(data []byte) error { return nil } + var invalidParameterMaximumLength InvalidParameterMaximumLength = InvalidParameterMaximumLength{} + if err := utils.UnmarshalJSON(data, &invalidParameterMaximumLength, "", true, true); err == nil { + u.InvalidParameterMaximumLength = &invalidParameterMaximumLength + u.Type = InvalidParametersTypeInvalidParameterMaximumLength + return nil + } + var invalidParameterChoiceItem InvalidParameterChoiceItem = InvalidParameterChoiceItem{} if err := utils.UnmarshalJSON(data, &invalidParameterChoiceItem, "", true, true); err == nil { u.InvalidParameterChoiceItem = &invalidParameterChoiceItem @@ -104,6 +122,10 @@ func (u InvalidParameters) MarshalJSON() ([]byte, error) { return utils.MarshalJSON(u.InvalidParameterMinimumLength, "", true) } + if u.InvalidParameterMaximumLength != nil { + return utils.MarshalJSON(u.InvalidParameterMaximumLength, "", true) + } + if u.InvalidParameterChoiceItem != nil { return utils.MarshalJSON(u.InvalidParameterChoiceItem, "", true) } diff --git a/models/components/invalidrules.go b/models/components/invalidrules.go index ae052ff..564f1bf 100644 --- a/models/components/invalidrules.go +++ b/models/components/invalidrules.go @@ -12,7 +12,6 @@ type InvalidRules string const ( InvalidRulesRequired InvalidRules = "required" - InvalidRulesMaxLength InvalidRules = "max_length" InvalidRulesIsArray InvalidRules = "is_array" InvalidRulesIsBase64 InvalidRules = "is_base64" InvalidRulesIsBoolean InvalidRules = "is_boolean" @@ -45,8 +44,6 @@ func (e *InvalidRules) UnmarshalJSON(data []byte) error { switch v { case "required": fallthrough - case "max_length": - fallthrough case "is_array": fallthrough case "is_base64": diff --git a/models/components/jwt.go b/models/components/jwt.go index 1a83495..2ed26a0 100644 --- a/models/components/jwt.go +++ b/models/components/jwt.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) type Algorithm string @@ -79,7 +78,7 @@ func (o *JWTConsumer) GetID() *string { } type Jwt struct { - Algorithm *Algorithm `default:"HS256" json:"algorithm"` + Algorithm *Algorithm `json:"algorithm,omitempty"` Consumer *JWTConsumer `json:"consumer,omitempty"` // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` @@ -90,17 +89,6 @@ type Jwt struct { Tags []string `json:"tags,omitempty"` } -func (j Jwt) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *Jwt) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - func (o *Jwt) GetAlgorithm() *Algorithm { if o == nil { return nil diff --git a/models/components/jwtwithoutparents.go b/models/components/jwtwithoutparents.go index e3cbe05..1e4cad7 100644 --- a/models/components/jwtwithoutparents.go +++ b/models/components/jwtwithoutparents.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) type JWTWithoutParentsAlgorithm string @@ -68,7 +67,7 @@ func (e *JWTWithoutParentsAlgorithm) UnmarshalJSON(data []byte) error { } type JWTWithoutParents struct { - Algorithm *JWTWithoutParentsAlgorithm `default:"HS256" json:"algorithm"` + Algorithm *JWTWithoutParentsAlgorithm `json:"algorithm,omitempty"` ID *string `json:"id,omitempty"` Key *string `json:"key,omitempty"` RsaPublicKey *string `json:"rsa_public_key,omitempty"` @@ -76,17 +75,6 @@ type JWTWithoutParents struct { Tags []string `json:"tags,omitempty"` } -func (j JWTWithoutParents) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(j, "", false) -} - -func (j *JWTWithoutParents) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &j, "", false, false); err != nil { - return err - } - return nil -} - func (o *JWTWithoutParents) GetAlgorithm() *JWTWithoutParentsAlgorithm { if o == nil { return nil diff --git a/models/components/keyauth.go b/models/components/keyauth.go index 140e3f2..226c3e3 100644 --- a/models/components/keyauth.go +++ b/models/components/keyauth.go @@ -18,7 +18,7 @@ type KeyAuth struct { // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` ID *string `json:"id,omitempty"` - Key *string `json:"key,omitempty"` + Key string `json:"key"` Tags []string `json:"tags,omitempty"` } @@ -43,9 +43,9 @@ func (o *KeyAuth) GetID() *string { return o.ID } -func (o *KeyAuth) GetKey() *string { +func (o *KeyAuth) GetKey() string { if o == nil { - return nil + return "" } return o.Key } diff --git a/models/components/keyauthwithoutparents.go b/models/components/keyauthwithoutparents.go index 174d77b..1148b61 100644 --- a/models/components/keyauthwithoutparents.go +++ b/models/components/keyauthwithoutparents.go @@ -4,7 +4,7 @@ package components type KeyAuthWithoutParents struct { ID *string `json:"id,omitempty"` - Key *string `json:"key,omitempty"` + Key string `json:"key"` Tags []string `json:"tags,omitempty"` } @@ -15,9 +15,9 @@ func (o *KeyAuthWithoutParents) GetID() *string { return o.ID } -func (o *KeyAuthWithoutParents) GetKey() *string { +func (o *KeyAuthWithoutParents) GetKey() string { if o == nil { - return nil + return "" } return o.Key } diff --git a/models/components/listgroupmemberships.go b/models/components/listgroupmemberships.go index cbe41e5..37b74b7 100644 --- a/models/components/listgroupmemberships.go +++ b/models/components/listgroupmemberships.go @@ -5,21 +5,21 @@ package components // ListGroupMemberships - A paginated list response for a collection of control plane group memberships. type ListGroupMemberships struct { // returns the pagination information - Meta *CursorPaginatedMetaWithSizeAndTotal `json:"meta,omitempty"` + Meta CursorPaginatedMetaWithSizeAndTotal `json:"meta"` // Array of control planes summary who are a child to this control plane group. - Data []ControlPlane `json:"data,omitempty"` + Data []ControlPlane `json:"data"` } -func (o *ListGroupMemberships) GetMeta() *CursorPaginatedMetaWithSizeAndTotal { +func (o *ListGroupMemberships) GetMeta() CursorPaginatedMetaWithSizeAndTotal { if o == nil { - return nil + return CursorPaginatedMetaWithSizeAndTotal{} } return o.Meta } func (o *ListGroupMemberships) GetData() []ControlPlane { if o == nil { - return nil + return []ControlPlane{} } return o.Data } diff --git a/models/components/meorganization.go b/models/components/meorganization.go index eca6c99..084199b 100644 --- a/models/components/meorganization.go +++ b/models/components/meorganization.go @@ -15,6 +15,8 @@ type MeOrganizationState string const ( MeOrganizationStateActive MeOrganizationState = "active" MeOrganizationStateInactive MeOrganizationState = "inactive" + MeOrganizationStateDeleting MeOrganizationState = "deleting" + MeOrganizationStateDeleted MeOrganizationState = "deleted" ) func (e MeOrganizationState) ToPointer() *MeOrganizationState { @@ -29,6 +31,10 @@ func (e *MeOrganizationState) UnmarshalJSON(data []byte) error { case "active": fallthrough case "inactive": + fallthrough + case "deleting": + fallthrough + case "deleted": *e = MeOrganizationState(v) return nil default: diff --git a/models/components/mtlsauth.go b/models/components/mtlsauth.go new file mode 100644 index 0000000..7378139 --- /dev/null +++ b/models/components/mtlsauth.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type MTLSAuthCaCertificate struct { + ID *string `json:"id,omitempty"` +} + +func (o *MTLSAuthCaCertificate) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +type MTLSAuthConsumer struct { + ID *string `json:"id,omitempty"` +} + +func (o *MTLSAuthConsumer) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +type MTLSAuth struct { + CaCertificate *MTLSAuthCaCertificate `json:"ca_certificate,omitempty"` + Consumer *MTLSAuthConsumer `json:"consumer,omitempty"` + // Unix epoch when the resource was created. + CreatedAt *int64 `json:"created_at,omitempty"` + ID *string `json:"id,omitempty"` + SubjectName string `json:"subject_name"` + Tags []string `json:"tags,omitempty"` +} + +func (o *MTLSAuth) GetCaCertificate() *MTLSAuthCaCertificate { + if o == nil { + return nil + } + return o.CaCertificate +} + +func (o *MTLSAuth) GetConsumer() *MTLSAuthConsumer { + if o == nil { + return nil + } + return o.Consumer +} + +func (o *MTLSAuth) GetCreatedAt() *int64 { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *MTLSAuth) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *MTLSAuth) GetSubjectName() string { + if o == nil { + return "" + } + return o.SubjectName +} + +func (o *MTLSAuth) GetTags() []string { + if o == nil { + return nil + } + return o.Tags +} diff --git a/models/components/mtlsauthwithoutparents.go b/models/components/mtlsauthwithoutparents.go new file mode 100644 index 0000000..9484650 --- /dev/null +++ b/models/components/mtlsauthwithoutparents.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package components + +type MTLSAuthWithoutParentsCaCertificate struct { + ID *string `json:"id,omitempty"` +} + +func (o *MTLSAuthWithoutParentsCaCertificate) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +type MTLSAuthWithoutParents struct { + CaCertificate *MTLSAuthWithoutParentsCaCertificate `json:"ca_certificate,omitempty"` + ID *string `json:"id,omitempty"` + SubjectName string `json:"subject_name"` + Tags []string `json:"tags,omitempty"` +} + +func (o *MTLSAuthWithoutParents) GetCaCertificate() *MTLSAuthWithoutParentsCaCertificate { + if o == nil { + return nil + } + return o.CaCertificate +} + +func (o *MTLSAuthWithoutParents) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +func (o *MTLSAuthWithoutParents) GetSubjectName() string { + if o == nil { + return "" + } + return o.SubjectName +} + +func (o *MTLSAuthWithoutParents) GetTags() []string { + if o == nil { + return nil + } + return o.Tags +} diff --git a/models/components/plugin.go b/models/components/plugin.go index cb04f76..832d065 100644 --- a/models/components/plugin.go +++ b/models/components/plugin.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) // PluginConsumer - If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer. @@ -156,7 +155,7 @@ type Plugin struct { // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` // Whether the plugin is applied. - Enabled *bool `default:"true" json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` ID *string `json:"id,omitempty"` InstanceName *string `json:"instance_name,omitempty"` // The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately. @@ -174,17 +173,6 @@ type Plugin struct { UpdatedAt *int64 `json:"updated_at,omitempty"` } -func (p Plugin) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Plugin) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - func (o *Plugin) GetConfig() map[string]any { if o == nil { return map[string]any{} @@ -291,7 +279,7 @@ type PluginInput struct { Consumer *PluginConsumer `json:"consumer,omitempty"` ConsumerGroup *PluginConsumerGroup `json:"consumer_group,omitempty"` // Whether the plugin is applied. - Enabled *bool `default:"true" json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` ID *string `json:"id,omitempty"` InstanceName *string `json:"instance_name,omitempty"` // The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately. @@ -307,17 +295,6 @@ type PluginInput struct { Tags []string `json:"tags,omitempty"` } -func (p PluginInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PluginInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - func (o *PluginInput) GetConfig() map[string]any { if o == nil { return map[string]any{} diff --git a/models/components/pluginwithoutparents.go b/models/components/pluginwithoutparents.go index 0a0a2c4..3756123 100644 --- a/models/components/pluginwithoutparents.go +++ b/models/components/pluginwithoutparents.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) type PluginWithoutParentsAfter struct { @@ -104,7 +103,7 @@ type PluginWithoutParents struct { // The configuration properties for the Plugin which can be found on the plugins documentation page in the [Kong Hub](https://docs.konghq.com/hub/). Config map[string]any `json:"config"` // Whether the plugin is applied. - Enabled *bool `default:"true" json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` ID *string `json:"id,omitempty"` InstanceName *string `json:"instance_name,omitempty"` // The name of the Plugin that's going to be added. Currently, the Plugin must be installed in every Kong instance separately. @@ -116,17 +115,6 @@ type PluginWithoutParents struct { Tags []string `json:"tags,omitempty"` } -func (p PluginWithoutParents) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PluginWithoutParents) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - func (o *PluginWithoutParents) GetConfig() map[string]any { if o == nil { return map[string]any{} diff --git a/models/components/route.go b/models/components/route.go index e5aede4..da7d915 100644 --- a/models/components/route.go +++ b/models/components/route.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) type Destinations struct { @@ -182,26 +181,26 @@ type Route struct { // A list of domain names that match this Route. Note that the hosts value is case sensitive. Hosts []string `json:"hosts,omitempty"` // The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is `HTTP` instead of `HTTPS`. `Location` header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the `https` protocol. - HTTPSRedirectStatusCode *HTTPSRedirectStatusCode `default:"426" json:"https_redirect_status_code"` + HTTPSRedirectStatusCode *HTTPSRedirectStatusCode `json:"https_redirect_status_code,omitempty"` ID *string `json:"id,omitempty"` // A list of HTTP methods that match this Route. Methods []string `json:"methods,omitempty"` // The name of the Route. Route names must be unique, and they are case sensitive. For example, there can be two different Routes named "test" and "Test". Name *string `json:"name,omitempty"` // Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior. - PathHandling *PathHandling `default:"v0" json:"path_handling"` + PathHandling *PathHandling `json:"path_handling,omitempty"` // A list of paths that match this Route. Paths []string `json:"paths,omitempty"` // When matching a Route via one of the `hosts` domain names, use the request `Host` header in the upstream request headers. If set to `false`, the upstream `Host` header will be that of the Service's `host`. - PreserveHost *bool `default:"false" json:"preserve_host"` + PreserveHost *bool `json:"preserve_host,omitempty"` // An array of the protocols this Route should allow. See the [Route Object](#route-object) section for a list of accepted protocols. When set to only `"https"`, HTTP requests are answered with an upgrade error. When set to only `"http"`, HTTPS requests are answered with an error. Protocols []RouteProtocols `json:"protocols,omitempty"` // A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same `regex_priority`, the older one (lowest `created_at`) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones). - RegexPriority *int64 `default:"0" json:"regex_priority"` + RegexPriority *int64 `json:"regex_priority,omitempty"` // Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. - RequestBuffering *bool `default:"true" json:"request_buffering"` + RequestBuffering *bool `json:"request_buffering,omitempty"` // Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. - ResponseBuffering *bool `default:"true" json:"response_buffering"` + ResponseBuffering *bool `json:"response_buffering,omitempty"` // The Service this Route is associated to. This is where the Route proxies traffic to. Service *RouteService `json:"service,omitempty"` // A list of SNIs that match this Route when using stream routing. @@ -209,24 +208,13 @@ type Route struct { // A list of IP sources of incoming connections that match this Route when using stream routing. Each entry is an object with fields "ip" (optionally in CIDR range notation) and/or "port". Sources []Sources `json:"sources,omitempty"` // When matching a Route via one of the `paths`, strip the matching prefix from the upstream request URL. - StripPath *bool `default:"true" json:"strip_path"` + StripPath *bool `json:"strip_path,omitempty"` // An optional set of strings associated with the Route for grouping and filtering. Tags []string `json:"tags,omitempty"` // Unix epoch when the resource was last updated. UpdatedAt *int64 `json:"updated_at,omitempty"` } -func (r Route) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *Route) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { - return err - } - return nil -} - func (o *Route) GetCreatedAt() *int64 { if o == nil { return nil @@ -383,26 +371,26 @@ type RouteInput struct { // A list of domain names that match this Route. Note that the hosts value is case sensitive. Hosts []string `json:"hosts,omitempty"` // The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is `HTTP` instead of `HTTPS`. `Location` header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the `https` protocol. - HTTPSRedirectStatusCode *HTTPSRedirectStatusCode `default:"426" json:"https_redirect_status_code"` + HTTPSRedirectStatusCode *HTTPSRedirectStatusCode `json:"https_redirect_status_code,omitempty"` ID *string `json:"id,omitempty"` // A list of HTTP methods that match this Route. Methods []string `json:"methods,omitempty"` // The name of the Route. Route names must be unique, and they are case sensitive. For example, there can be two different Routes named "test" and "Test". Name *string `json:"name,omitempty"` // Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior. - PathHandling *PathHandling `default:"v0" json:"path_handling"` + PathHandling *PathHandling `json:"path_handling,omitempty"` // A list of paths that match this Route. Paths []string `json:"paths,omitempty"` // When matching a Route via one of the `hosts` domain names, use the request `Host` header in the upstream request headers. If set to `false`, the upstream `Host` header will be that of the Service's `host`. - PreserveHost *bool `default:"false" json:"preserve_host"` + PreserveHost *bool `json:"preserve_host,omitempty"` // An array of the protocols this Route should allow. See the [Route Object](#route-object) section for a list of accepted protocols. When set to only `"https"`, HTTP requests are answered with an upgrade error. When set to only `"http"`, HTTPS requests are answered with an error. Protocols []RouteProtocols `json:"protocols,omitempty"` // A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same `regex_priority`, the older one (lowest `created_at`) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones). - RegexPriority *int64 `default:"0" json:"regex_priority"` + RegexPriority *int64 `json:"regex_priority,omitempty"` // Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. - RequestBuffering *bool `default:"true" json:"request_buffering"` + RequestBuffering *bool `json:"request_buffering,omitempty"` // Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. - ResponseBuffering *bool `default:"true" json:"response_buffering"` + ResponseBuffering *bool `json:"response_buffering,omitempty"` // The Service this Route is associated to. This is where the Route proxies traffic to. Service *RouteService `json:"service,omitempty"` // A list of SNIs that match this Route when using stream routing. @@ -410,22 +398,11 @@ type RouteInput struct { // A list of IP sources of incoming connections that match this Route when using stream routing. Each entry is an object with fields "ip" (optionally in CIDR range notation) and/or "port". Sources []Sources `json:"sources,omitempty"` // When matching a Route via one of the `paths`, strip the matching prefix from the upstream request URL. - StripPath *bool `default:"true" json:"strip_path"` + StripPath *bool `json:"strip_path,omitempty"` // An optional set of strings associated with the Route for grouping and filtering. Tags []string `json:"tags,omitempty"` } -func (r RouteInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *RouteInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { - return err - } - return nil -} - func (o *RouteInput) GetDestinations() []Destinations { if o == nil { return nil diff --git a/models/components/routewithoutparents.go b/models/components/routewithoutparents.go index 242dc4f..47b6d45 100644 --- a/models/components/routewithoutparents.go +++ b/models/components/routewithoutparents.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) type RouteWithoutParentsDestinations struct { @@ -168,47 +167,36 @@ type RouteWithoutParents struct { // A list of domain names that match this Route. Note that the hosts value is case sensitive. Hosts []string `json:"hosts,omitempty"` // The status code Kong responds with when all properties of a Route match except the protocol i.e. if the protocol of the request is `HTTP` instead of `HTTPS`. `Location` header is injected by Kong if the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the `https` protocol. - HTTPSRedirectStatusCode *RouteWithoutParentsHTTPSRedirectStatusCode `default:"426" json:"https_redirect_status_code"` + HTTPSRedirectStatusCode *RouteWithoutParentsHTTPSRedirectStatusCode `json:"https_redirect_status_code,omitempty"` ID *string `json:"id,omitempty"` // A list of HTTP methods that match this Route. Methods []string `json:"methods,omitempty"` // The name of the Route. Route names must be unique, and they are case sensitive. For example, there can be two different Routes named "test" and "Test". Name *string `json:"name,omitempty"` // Controls how the Service path, Route path and requested path are combined when sending a request to the upstream. See above for a detailed description of each behavior. - PathHandling *RouteWithoutParentsPathHandling `default:"v0" json:"path_handling"` + PathHandling *RouteWithoutParentsPathHandling `json:"path_handling,omitempty"` // A list of paths that match this Route. Paths []string `json:"paths,omitempty"` // When matching a Route via one of the `hosts` domain names, use the request `Host` header in the upstream request headers. If set to `false`, the upstream `Host` header will be that of the Service's `host`. - PreserveHost *bool `default:"false" json:"preserve_host"` + PreserveHost *bool `json:"preserve_host,omitempty"` // An array of the protocols this Route should allow. See the [Route Object](#route-object) section for a list of accepted protocols. When set to only `"https"`, HTTP requests are answered with an upgrade error. When set to only `"http"`, HTTPS requests are answered with an error. Protocols []RouteWithoutParentsProtocols `json:"protocols,omitempty"` // A number used to choose which route resolves a given request when several routes match it using regexes simultaneously. When two routes match the path and have the same `regex_priority`, the older one (lowest `created_at`) is used. Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones). - RegexPriority *int64 `default:"0" json:"regex_priority"` + RegexPriority *int64 `json:"regex_priority,omitempty"` // Whether to enable request body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that receive data with chunked transfer encoding. - RequestBuffering *bool `default:"true" json:"request_buffering"` + RequestBuffering *bool `json:"request_buffering,omitempty"` // Whether to enable response body buffering or not. With HTTP 1.1, it may make sense to turn this off on services that send data with chunked transfer encoding. - ResponseBuffering *bool `default:"true" json:"response_buffering"` + ResponseBuffering *bool `json:"response_buffering,omitempty"` // A list of SNIs that match this Route when using stream routing. Snis []string `json:"snis,omitempty"` // A list of IP sources of incoming connections that match this Route when using stream routing. Each entry is an object with fields "ip" (optionally in CIDR range notation) and/or "port". Sources []RouteWithoutParentsSources `json:"sources,omitempty"` // When matching a Route via one of the `paths`, strip the matching prefix from the upstream request URL. - StripPath *bool `default:"true" json:"strip_path"` + StripPath *bool `json:"strip_path,omitempty"` // An optional set of strings associated with the Route for grouping and filtering. Tags []string `json:"tags,omitempty"` } -func (r RouteWithoutParents) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(r, "", false) -} - -func (r *RouteWithoutParents) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &r, "", false, false); err != nil { - return err - } - return nil -} - func (o *RouteWithoutParents) GetDestinations() []RouteWithoutParentsDestinations { if o == nil { return nil diff --git a/models/components/service.go b/models/components/service.go index 48ebfd3..768a748 100644 --- a/models/components/service.go +++ b/models/components/service.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) // ClientCertificate - Certificate to be used as client certificate while TLS handshaking to the upstream server. @@ -78,11 +77,11 @@ type Service struct { // Certificate to be used as client certificate while TLS handshaking to the upstream server. ClientCertificate *ClientCertificate `json:"client_certificate,omitempty"` // The timeout in milliseconds for establishing a connection to the upstream server. - ConnectTimeout *int64 `default:"60000" json:"connect_timeout"` + ConnectTimeout *int64 `json:"connect_timeout,omitempty"` // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` // Whether the Service is active. If set to `false`, the proxy behavior will be as if any routes attached to it do not exist (404). Default: `true`. - Enabled *bool `default:"true" json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` // The host of the upstream server. Note that the host value is case sensitive. Host string `json:"host"` ID *string `json:"id,omitempty"` @@ -91,13 +90,13 @@ type Service struct { // The path to be used in requests to the upstream server. Path *string `json:"path,omitempty"` // The upstream server port. - Port *int64 `default:"80" json:"port"` + Port int64 `json:"port"` // The protocol used to communicate with the upstream. - Protocol *Protocol `default:"http" json:"protocol"` + Protocol Protocol `json:"protocol"` // The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. - ReadTimeout *int64 `default:"60000" json:"read_timeout"` + ReadTimeout *int64 `json:"read_timeout,omitempty"` // The number of retries to execute upon failure to proxy. - Retries *int64 `default:"5" json:"retries"` + Retries *int64 `json:"retries,omitempty"` // An optional set of strings associated with the Service for grouping and filtering. Tags []string `json:"tags,omitempty"` // Whether to enable verification of upstream server TLS certificate. If set to `null`, then the Nginx default is respected. @@ -107,18 +106,7 @@ type Service struct { // Unix epoch when the resource was last updated. UpdatedAt *int64 `json:"updated_at,omitempty"` // The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server. - WriteTimeout *int64 `default:"60000" json:"write_timeout"` -} - -func (s Service) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *Service) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil + WriteTimeout *int64 `json:"write_timeout,omitempty"` } func (o *Service) GetCaCertificates() []string { @@ -184,16 +172,16 @@ func (o *Service) GetPath() *string { return o.Path } -func (o *Service) GetPort() *int64 { +func (o *Service) GetPort() int64 { if o == nil { - return nil + return 0 } return o.Port } -func (o *Service) GetProtocol() *Protocol { +func (o *Service) GetProtocol() Protocol { if o == nil { - return nil + return Protocol("") } return o.Protocol } @@ -254,9 +242,9 @@ type ServiceInput struct { // Certificate to be used as client certificate while TLS handshaking to the upstream server. ClientCertificate *ClientCertificate `json:"client_certificate,omitempty"` // The timeout in milliseconds for establishing a connection to the upstream server. - ConnectTimeout *int64 `default:"60000" json:"connect_timeout"` + ConnectTimeout *int64 `json:"connect_timeout,omitempty"` // Whether the Service is active. If set to `false`, the proxy behavior will be as if any routes attached to it do not exist (404). Default: `true`. - Enabled *bool `default:"true" json:"enabled"` + Enabled *bool `json:"enabled,omitempty"` // The host of the upstream server. Note that the host value is case sensitive. Host string `json:"host"` ID *string `json:"id,omitempty"` @@ -265,13 +253,13 @@ type ServiceInput struct { // The path to be used in requests to the upstream server. Path *string `json:"path,omitempty"` // The upstream server port. - Port *int64 `default:"80" json:"port"` + Port int64 `json:"port"` // The protocol used to communicate with the upstream. - Protocol *Protocol `default:"http" json:"protocol"` + Protocol Protocol `json:"protocol"` // The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. - ReadTimeout *int64 `default:"60000" json:"read_timeout"` + ReadTimeout *int64 `json:"read_timeout,omitempty"` // The number of retries to execute upon failure to proxy. - Retries *int64 `default:"5" json:"retries"` + Retries *int64 `json:"retries,omitempty"` // An optional set of strings associated with the Service for grouping and filtering. Tags []string `json:"tags,omitempty"` // Whether to enable verification of upstream server TLS certificate. If set to `null`, then the Nginx default is respected. @@ -281,18 +269,7 @@ type ServiceInput struct { // Helper field to set `protocol`, `host`, `port` and `path` using a URL. This field is write-only and is not returned in responses. URL *string `json:"url,omitempty"` // The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server. - WriteTimeout *int64 `default:"60000" json:"write_timeout"` -} - -func (s ServiceInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *ServiceInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil { - return err - } - return nil + WriteTimeout *int64 `json:"write_timeout,omitempty"` } func (o *ServiceInput) GetCaCertificates() []string { @@ -351,16 +328,16 @@ func (o *ServiceInput) GetPath() *string { return o.Path } -func (o *ServiceInput) GetPort() *int64 { +func (o *ServiceInput) GetPort() int64 { if o == nil { - return nil + return 0 } return o.Port } -func (o *ServiceInput) GetProtocol() *Protocol { +func (o *ServiceInput) GetProtocol() Protocol { if o == nil { - return nil + return Protocol("") } return o.Protocol } diff --git a/models/components/sni.go b/models/components/sni.go index 73d328b..1803a44 100644 --- a/models/components/sni.go +++ b/models/components/sni.go @@ -17,7 +17,7 @@ func (o *SNICertificate) GetID() *string { // Sni - An SNI object represents a many-to-one mapping of hostnames to a certificate. That is, a certificate object can have many hostnames associated with it; when Kong receives an SSL request, it uses the SNI field in the Client Hello to lookup the certificate object based on the SNI associated with the certificate. type Sni struct { // The id (a UUID) of the certificate with which to associate the SNI hostname. The Certificate must have a valid private key associated with it to be used by the SNI object. - Certificate SNICertificate `json:"certificate"` + Certificate *SNICertificate `json:"certificate"` // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` ID *string `json:"id,omitempty"` @@ -29,9 +29,9 @@ type Sni struct { UpdatedAt *int64 `json:"updated_at,omitempty"` } -func (o *Sni) GetCertificate() SNICertificate { +func (o *Sni) GetCertificate() *SNICertificate { if o == nil { - return SNICertificate{} + return nil } return o.Certificate } @@ -74,17 +74,17 @@ func (o *Sni) GetUpdatedAt() *int64 { // SNIInput - An SNI object represents a many-to-one mapping of hostnames to a certificate. That is, a certificate object can have many hostnames associated with it; when Kong receives an SSL request, it uses the SNI field in the Client Hello to lookup the certificate object based on the SNI associated with the certificate. type SNIInput struct { // The id (a UUID) of the certificate with which to associate the SNI hostname. The Certificate must have a valid private key associated with it to be used by the SNI object. - Certificate SNICertificate `json:"certificate"` - ID *string `json:"id,omitempty"` + Certificate *SNICertificate `json:"certificate"` + ID *string `json:"id,omitempty"` // The SNI name to associate with the given certificate. Name string `json:"name"` // An optional set of strings associated with the SNIs for grouping and filtering. Tags []string `json:"tags,omitempty"` } -func (o *SNIInput) GetCertificate() SNICertificate { +func (o *SNIInput) GetCertificate() *SNICertificate { if o == nil { - return SNICertificate{} + return nil } return o.Certificate } diff --git a/models/components/target.go b/models/components/target.go index b89be0a..c49061e 100644 --- a/models/components/target.go +++ b/models/components/target.go @@ -2,10 +2,6 @@ package components -import ( - "github.com/Kong/sdk-konnect-go/internal/utils" -) - type TargetUpstream struct { ID *string `json:"id,omitempty"` } @@ -30,18 +26,7 @@ type Target struct { UpdatedAt *float64 `json:"updated_at,omitempty"` Upstream *TargetUpstream `json:"upstream,omitempty"` // The weight this target gets within the upstream loadbalancer (`0`-`65535`). If the hostname resolves to an SRV record, the `weight` value will be overridden by the value from the DNS record. - Weight *int64 `default:"100" json:"weight"` -} - -func (t Target) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *Target) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil + Weight *int64 `json:"weight,omitempty"` } func (o *Target) GetCreatedAt() *float64 { diff --git a/models/components/targetwithoutparents.go b/models/components/targetwithoutparents.go index db273fe..7213253 100644 --- a/models/components/targetwithoutparents.go +++ b/models/components/targetwithoutparents.go @@ -2,10 +2,6 @@ package components -import ( - "github.com/Kong/sdk-konnect-go/internal/utils" -) - // TargetWithoutParents - A target is an ip address/hostname with a port that identifies an instance of a backend service. Every upstream can have many targets, and the targets can be dynamically added, modified, or deleted. Changes take effect on the fly. To disable a target, post a new one with `weight=0`; alternatively, use the `DELETE` convenience method to accomplish the same. The current target object definition is the one with the latest `created_at`. type TargetWithoutParents struct { ID *string `json:"id,omitempty"` @@ -14,18 +10,7 @@ type TargetWithoutParents struct { // The target address (ip or hostname) and port. If the hostname resolves to an SRV record, the `port` value will be overridden by the value from the DNS record. Target *string `json:"target,omitempty"` // The weight this target gets within the upstream loadbalancer (`0`-`65535`). If the hostname resolves to an SRV record, the `weight` value will be overridden by the value from the DNS record. - Weight *int64 `default:"100" json:"weight"` -} - -func (t TargetWithoutParents) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TargetWithoutParents) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil + Weight *int64 `json:"weight,omitempty"` } func (o *TargetWithoutParents) GetID() *string { diff --git a/models/components/team.go b/models/components/team.go index 98cd870..1c23ef6 100644 --- a/models/components/team.go +++ b/models/components/team.go @@ -16,7 +16,7 @@ type Team struct { // The team description in Konnect. Description *string `json:"description,omitempty"` // Returns True if a user belongs to a `system_team`. System teams are teams that can manage Konnect objects, like "Organization Admin", or "Service" - SystemTeam *bool `default:"false" json:"system_team"` + SystemTeam *bool `json:"system_team,omitempty"` // Labels store metadata of an entity that can be used for filtering an entity list or for searching across entity types. // // Keys must be of length 1-63 characters, and cannot start with "kong", "konnect", "mesh", "kic", or "_". diff --git a/models/components/updateidpconfiguration.go b/models/components/updateidpconfiguration.go index 2fbf920..147400f 100644 --- a/models/components/updateidpconfiguration.go +++ b/models/components/updateidpconfiguration.go @@ -2,25 +2,10 @@ package components -import ( - "github.com/Kong/sdk-konnect-go/internal/utils" -) - type UpdateIDPConfigurationClaimMappings struct { - Name *string `default:"name" json:"name"` - Email *string `default:"email" json:"email"` - Groups *string `default:"groups" json:"groups"` -} - -func (u UpdateIDPConfigurationClaimMappings) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpdateIDPConfigurationClaimMappings) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil + Name *string `json:"name,omitempty"` + Email *string `json:"email,omitempty"` + Groups *string `json:"groups,omitempty"` } func (o *UpdateIDPConfigurationClaimMappings) GetName() *string { diff --git a/models/components/upstream.go b/models/components/upstream.go index 7eb5a84..9d1d232 100644 --- a/models/components/upstream.go +++ b/models/components/upstream.go @@ -5,7 +5,6 @@ package components import ( "encoding/json" "fmt" - "github.com/Kong/sdk-konnect-go/internal/utils" ) // UpstreamAlgorithm - Which load balancing algorithm to use. @@ -145,19 +144,8 @@ func (e *HashOn) UnmarshalJSON(data []byte) error { type Healthy struct { HTTPStatuses []int64 `json:"http_statuses,omitempty"` - Interval *float64 `default:"0" json:"interval"` - Successes *int64 `default:"0" json:"successes"` -} - -func (h Healthy) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *Healthy) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil + Interval *float64 `json:"interval,omitempty"` + Successes *int64 `json:"successes,omitempty"` } func (o *Healthy) GetHTTPStatuses() []int64 { @@ -217,22 +205,11 @@ func (e *Type) UnmarshalJSON(data []byte) error { } type Unhealthy struct { - HTTPFailures *int64 `default:"0" json:"http_failures"` + HTTPFailures *int64 `json:"http_failures,omitempty"` HTTPStatuses []int64 `json:"http_statuses,omitempty"` - Interval *float64 `default:"0" json:"interval"` - TCPFailures *int64 `default:"0" json:"tcp_failures"` - Timeouts *int64 `default:"0" json:"timeouts"` -} - -func (u Unhealthy) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *Unhealthy) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil + Interval *float64 `json:"interval,omitempty"` + TCPFailures *int64 `json:"tcp_failures,omitempty"` + Timeouts *int64 `json:"timeouts,omitempty"` } func (o *Unhealthy) GetHTTPFailures() *int64 { @@ -271,28 +248,17 @@ func (o *Unhealthy) GetTimeouts() *int64 { } type Active struct { - Concurrency *int64 `default:"10" json:"concurrency"` + Concurrency *int64 `json:"concurrency,omitempty"` Headers map[string]string `json:"headers,omitempty"` Healthy *Healthy `json:"healthy,omitempty"` - HTTPPath *string `default:"/" json:"http_path"` + HTTPPath *string `json:"http_path,omitempty"` HTTPSSni *string `json:"https_sni,omitempty"` - HTTPSVerifyCertificate *bool `default:"true" json:"https_verify_certificate"` - Timeout *float64 `default:"1" json:"timeout"` - Type *Type `default:"http" json:"type"` + HTTPSVerifyCertificate *bool `json:"https_verify_certificate,omitempty"` + Timeout *float64 `json:"timeout,omitempty"` + Type *Type `json:"type,omitempty"` Unhealthy *Unhealthy `json:"unhealthy,omitempty"` } -func (a Active) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(a, "", false) -} - -func (a *Active) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &a, "", false, false); err != nil { - return err - } - return nil -} - func (o *Active) GetConcurrency() *int64 { if o == nil { return nil @@ -358,18 +324,7 @@ func (o *Active) GetUnhealthy() *Unhealthy { type UpstreamHealthy struct { HTTPStatuses []int64 `json:"http_statuses,omitempty"` - Successes *int64 `default:"0" json:"successes"` -} - -func (u UpstreamHealthy) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpstreamHealthy) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil + Successes *int64 `json:"successes,omitempty"` } func (o *UpstreamHealthy) GetHTTPStatuses() []int64 { @@ -422,21 +377,10 @@ func (e *UpstreamType) UnmarshalJSON(data []byte) error { } type UpstreamUnhealthy struct { - HTTPFailures *int64 `default:"0" json:"http_failures"` + HTTPFailures *int64 `json:"http_failures,omitempty"` HTTPStatuses []int64 `json:"http_statuses,omitempty"` - TCPFailures *int64 `default:"0" json:"tcp_failures"` - Timeouts *int64 `default:"0" json:"timeouts"` -} - -func (u UpstreamUnhealthy) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpstreamUnhealthy) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil + TCPFailures *int64 `json:"tcp_failures,omitempty"` + Timeouts *int64 `json:"timeouts,omitempty"` } func (o *UpstreamUnhealthy) GetHTTPFailures() *int64 { @@ -469,21 +413,10 @@ func (o *UpstreamUnhealthy) GetTimeouts() *int64 { type Passive struct { Healthy *UpstreamHealthy `json:"healthy,omitempty"` - Type *UpstreamType `default:"http" json:"type"` + Type *UpstreamType `json:"type,omitempty"` Unhealthy *UpstreamUnhealthy `json:"unhealthy,omitempty"` } -func (p Passive) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *Passive) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { - return err - } - return nil -} - func (o *Passive) GetHealthy() *UpstreamHealthy { if o == nil { return nil @@ -508,18 +441,7 @@ func (o *Passive) GetUnhealthy() *UpstreamUnhealthy { type Healthchecks struct { Active *Active `json:"active,omitempty"` Passive *Passive `json:"passive,omitempty"` - Threshold *float64 `default:"0" json:"threshold"` -} - -func (h Healthchecks) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(h, "", false) -} - -func (h *Healthchecks) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &h, "", false, false); err != nil { - return err - } - return nil + Threshold *float64 `json:"threshold,omitempty"` } func (o *Healthchecks) GetActive() *Active { @@ -546,13 +468,13 @@ func (o *Healthchecks) GetThreshold() *float64 { // Upstream - The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named `service.v1.xyz` for a Service object whose `host` is `service.v1.xyz`. Requests for this Service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets. type Upstream struct { // Which load balancing algorithm to use. - Algorithm *UpstreamAlgorithm `default:"round-robin" json:"algorithm"` + Algorithm *UpstreamAlgorithm `json:"algorithm,omitempty"` // If set, the certificate to be used as client certificate while TLS handshaking to the upstream server. ClientCertificate *UpstreamClientCertificate `json:"client_certificate,omitempty"` // Unix epoch when the resource was created. CreatedAt *int64 `json:"created_at,omitempty"` // What to use as hashing input if the primary `hash_on` does not return a hash (eg. header is missing, or no Consumer identified). Not available if `hash_on` is set to `cookie`. - HashFallback *HashFallback `default:"none" json:"hash_fallback"` + HashFallback *HashFallback `json:"hash_fallback,omitempty"` // The header name to take the value from as hash input. Only required when `hash_fallback` is set to `header`. HashFallbackHeader *string `json:"hash_fallback_header,omitempty"` // The name of the query string argument to take the value from as hash input. Only required when `hash_fallback` is set to `query_arg`. @@ -560,11 +482,11 @@ type Upstream struct { // The name of the route URI capture to take the value from as hash input. Only required when `hash_fallback` is set to `uri_capture`. HashFallbackURICapture *string `json:"hash_fallback_uri_capture,omitempty"` // What to use as hashing input. Using `none` results in a weighted-round-robin scheme with no hashing. - HashOn *HashOn `default:"none" json:"hash_on"` + HashOn *HashOn `json:"hash_on,omitempty"` // The cookie name to take the value from as hash input. Only required when `hash_on` or `hash_fallback` is set to `cookie`. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response. HashOnCookie *string `json:"hash_on_cookie,omitempty"` // The cookie path to set in the response headers. Only required when `hash_on` or `hash_fallback` is set to `cookie`. - HashOnCookiePath *string `default:"/" json:"hash_on_cookie_path"` + HashOnCookiePath *string `json:"hash_on_cookie_path,omitempty"` // The header name to take the value from as hash input. Only required when `hash_on` is set to `header`. HashOnHeader *string `json:"hash_on_header,omitempty"` // The name of the query string argument to take the value from as hash input. Only required when `hash_on` is set to `query_arg`. @@ -578,24 +500,13 @@ type Upstream struct { // This is a hostname, which must be equal to the `host` of a Service. Name string `json:"name"` // The number of slots in the load balancer algorithm. If `algorithm` is set to `round-robin`, this setting determines the maximum number of slots. If `algorithm` is set to `consistent-hashing`, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range `10`-`65536`. - Slots *int64 `default:"10000" json:"slots"` + Slots *int64 `json:"slots,omitempty"` // An optional set of strings associated with the Upstream for grouping and filtering. Tags []string `json:"tags,omitempty"` // Unix epoch when the resource was last updated. UpdatedAt *int64 `json:"updated_at,omitempty"` // If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream `Host`. - UseSrvName *bool `default:"false" json:"use_srv_name"` -} - -func (u Upstream) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *Upstream) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil + UseSrvName *bool `json:"use_srv_name,omitempty"` } func (o *Upstream) GetAlgorithm() *UpstreamAlgorithm { @@ -748,11 +659,11 @@ func (o *Upstream) GetUseSrvName() *bool { // UpstreamInput - The upstream object represents a virtual hostname and can be used to loadbalance incoming requests over multiple services (targets). So for example an upstream named `service.v1.xyz` for a Service object whose `host` is `service.v1.xyz`. Requests for this Service would be proxied to the targets defined within the upstream. An upstream also includes a [health checker][healthchecks], which is able to enable and disable targets based on their ability or inability to serve requests. The configuration for the health checker is stored in the upstream object, and applies to all of its targets. type UpstreamInput struct { // Which load balancing algorithm to use. - Algorithm *UpstreamAlgorithm `default:"round-robin" json:"algorithm"` + Algorithm *UpstreamAlgorithm `json:"algorithm,omitempty"` // If set, the certificate to be used as client certificate while TLS handshaking to the upstream server. ClientCertificate *UpstreamClientCertificate `json:"client_certificate,omitempty"` // What to use as hashing input if the primary `hash_on` does not return a hash (eg. header is missing, or no Consumer identified). Not available if `hash_on` is set to `cookie`. - HashFallback *HashFallback `default:"none" json:"hash_fallback"` + HashFallback *HashFallback `json:"hash_fallback,omitempty"` // The header name to take the value from as hash input. Only required when `hash_fallback` is set to `header`. HashFallbackHeader *string `json:"hash_fallback_header,omitempty"` // The name of the query string argument to take the value from as hash input. Only required when `hash_fallback` is set to `query_arg`. @@ -760,11 +671,11 @@ type UpstreamInput struct { // The name of the route URI capture to take the value from as hash input. Only required when `hash_fallback` is set to `uri_capture`. HashFallbackURICapture *string `json:"hash_fallback_uri_capture,omitempty"` // What to use as hashing input. Using `none` results in a weighted-round-robin scheme with no hashing. - HashOn *HashOn `default:"none" json:"hash_on"` + HashOn *HashOn `json:"hash_on,omitempty"` // The cookie name to take the value from as hash input. Only required when `hash_on` or `hash_fallback` is set to `cookie`. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response. HashOnCookie *string `json:"hash_on_cookie,omitempty"` // The cookie path to set in the response headers. Only required when `hash_on` or `hash_fallback` is set to `cookie`. - HashOnCookiePath *string `default:"/" json:"hash_on_cookie_path"` + HashOnCookiePath *string `json:"hash_on_cookie_path,omitempty"` // The header name to take the value from as hash input. Only required when `hash_on` is set to `header`. HashOnHeader *string `json:"hash_on_header,omitempty"` // The name of the query string argument to take the value from as hash input. Only required when `hash_on` is set to `query_arg`. @@ -778,22 +689,11 @@ type UpstreamInput struct { // This is a hostname, which must be equal to the `host` of a Service. Name string `json:"name"` // The number of slots in the load balancer algorithm. If `algorithm` is set to `round-robin`, this setting determines the maximum number of slots. If `algorithm` is set to `consistent-hashing`, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range `10`-`65536`. - Slots *int64 `default:"10000" json:"slots"` + Slots *int64 `json:"slots,omitempty"` // An optional set of strings associated with the Upstream for grouping and filtering. Tags []string `json:"tags,omitempty"` // If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream `Host`. - UseSrvName *bool `default:"false" json:"use_srv_name"` -} - -func (u UpstreamInput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(u, "", false) -} - -func (u *UpstreamInput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { - return err - } - return nil + UseSrvName *bool `json:"use_srv_name,omitempty"` } func (o *UpstreamInput) GetAlgorithm() *UpstreamAlgorithm { diff --git a/models/components/user.go b/models/components/user.go index ef4c05a..754f6ea 100644 --- a/models/components/user.go +++ b/models/components/user.go @@ -18,7 +18,7 @@ type User struct { // The User's preferred name. PreferredName *string `json:"preferred_name,omitempty"` // Returns True if a user has verified their email address. - Active *bool `default:"true" json:"active"` + Active *bool `json:"active,omitempty"` // The time stamp for the date the account was registered. CreatedAt *time.Time `json:"created_at,omitempty"` // A Unix timestamp representation of the most recent change to the User account. diff --git a/models/operations/addconsumertospecificconsumergroup.go b/models/operations/addconsumertospecificconsumergroup.go new file mode 100644 index 0000000..f281faa --- /dev/null +++ b/models/operations/addconsumertospecificconsumergroup.go @@ -0,0 +1,108 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type AddConsumerToSpecificConsumerGroupRequestBody struct { + Group *string `json:"group,omitempty"` +} + +func (o *AddConsumerToSpecificConsumerGroupRequestBody) GetGroup() *string { + if o == nil { + return nil + } + return o.Group +} + +type AddConsumerToSpecificConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // The UUID of the consumer. + ConsumerID string `pathParam:"style=simple,explode=false,name=ConsumerId"` + RequestBody *AddConsumerToSpecificConsumerGroupRequestBody `request:"mediaType=application/json"` +} + +func (o *AddConsumerToSpecificConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *AddConsumerToSpecificConsumerGroupRequest) GetConsumerID() string { + if o == nil { + return "" + } + return o.ConsumerID +} + +func (o *AddConsumerToSpecificConsumerGroupRequest) GetRequestBody() *AddConsumerToSpecificConsumerGroupRequestBody { + if o == nil { + return nil + } + return o.RequestBody +} + +// AddConsumerToSpecificConsumerGroupResponseBody - Consumer added to a specific group +type AddConsumerToSpecificConsumerGroupResponseBody struct { + // The Consumer object represents a consumer - or a user - of a Service. You can either rely on Kong as the primary datastore, or you can map the consumer list with your database to keep consistency between Kong and your existing primary datastore. + Consumer *components.Consumer `json:"consumer,omitempty"` + ConsumerGroups []components.ConsumerGroup `json:"consumer_groups,omitempty"` +} + +func (o *AddConsumerToSpecificConsumerGroupResponseBody) GetConsumer() *components.Consumer { + if o == nil { + return nil + } + return o.Consumer +} + +func (o *AddConsumerToSpecificConsumerGroupResponseBody) GetConsumerGroups() []components.ConsumerGroup { + if o == nil { + return nil + } + return o.ConsumerGroups +} + +type AddConsumerToSpecificConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Consumer added to a specific group + Object *AddConsumerToSpecificConsumerGroupResponseBody +} + +func (o *AddConsumerToSpecificConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *AddConsumerToSpecificConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AddConsumerToSpecificConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *AddConsumerToSpecificConsumerGroupResponse) GetObject() *AddConsumerToSpecificConsumerGroupResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/createmtlsauthwithconsumer.go b/models/operations/createmtlsauthwithconsumer.go new file mode 100644 index 0000000..7204597 --- /dev/null +++ b/models/operations/createmtlsauthwithconsumer.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type CreateMtlsAuthWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // Description of new MTLS-auth credential for creation + MTLSAuthWithoutParents components.MTLSAuthWithoutParents `request:"mediaType=application/json"` +} + +func (o *CreateMtlsAuthWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *CreateMtlsAuthWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *CreateMtlsAuthWithConsumerRequest) GetMTLSAuthWithoutParents() components.MTLSAuthWithoutParents { + if o == nil { + return components.MTLSAuthWithoutParents{} + } + return o.MTLSAuthWithoutParents +} + +type CreateMtlsAuthWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully created MTLS-auth credential + MTLSAuth *components.MTLSAuth +} + +func (o *CreateMtlsAuthWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreateMtlsAuthWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreateMtlsAuthWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreateMtlsAuthWithConsumerResponse) GetMTLSAuth() *components.MTLSAuth { + if o == nil { + return nil + } + return o.MTLSAuth +} diff --git a/models/operations/createpluginwithconsumer.go b/models/operations/createpluginwithconsumer.go new file mode 100644 index 0000000..1e71db9 --- /dev/null +++ b/models/operations/createpluginwithconsumer.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type CreatePluginWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // Description of new Plugin for creation + PluginWithoutParents components.PluginWithoutParents `request:"mediaType=application/json"` +} + +func (o *CreatePluginWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *CreatePluginWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *CreatePluginWithConsumerRequest) GetPluginWithoutParents() components.PluginWithoutParents { + if o == nil { + return components.PluginWithoutParents{} + } + return o.PluginWithoutParents +} + +type CreatePluginWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully created Plugin + Plugin *components.Plugin +} + +func (o *CreatePluginWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreatePluginWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreatePluginWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreatePluginWithConsumerResponse) GetPlugin() *components.Plugin { + if o == nil { + return nil + } + return o.Plugin +} diff --git a/models/operations/createpluginwithconsumergroup.go b/models/operations/createpluginwithconsumergroup.go new file mode 100644 index 0000000..64fe02f --- /dev/null +++ b/models/operations/createpluginwithconsumergroup.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type CreatePluginWithConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // ID of the Consumer Group to lookup + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` + // Description of new Plugin for creation + PluginWithoutParents components.PluginWithoutParents `request:"mediaType=application/json"` +} + +func (o *CreatePluginWithConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *CreatePluginWithConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +func (o *CreatePluginWithConsumerGroupRequest) GetPluginWithoutParents() components.PluginWithoutParents { + if o == nil { + return components.PluginWithoutParents{} + } + return o.PluginWithoutParents +} + +type CreatePluginWithConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully created Plugin + Plugin *components.Plugin +} + +func (o *CreatePluginWithConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreatePluginWithConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreatePluginWithConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *CreatePluginWithConsumerGroupResponse) GetPlugin() *components.Plugin { + if o == nil { + return nil + } + return o.Plugin +} diff --git a/models/operations/deleteconsumer.go b/models/operations/deleteconsumer.go index 8f6e790..6531788 100644 --- a/models/operations/deleteconsumer.go +++ b/models/operations/deleteconsumer.go @@ -9,7 +9,7 @@ import ( type DeleteConsumerRequest struct { // The UUID of your control plane. This variable is available in the Konnect manager. ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` - // ID of the Consumer to lookup + // The UUID of the consumer. ConsumerID string `pathParam:"style=simple,explode=false,name=ConsumerId"` } diff --git a/models/operations/deletemtlsauthwithconsumer.go b/models/operations/deletemtlsauthwithconsumer.go new file mode 100644 index 0000000..331c7be --- /dev/null +++ b/models/operations/deletemtlsauthwithconsumer.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type DeleteMtlsAuthWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // ID of the MTLS-auth credential to lookup + MTLSAuthID string `pathParam:"style=simple,explode=false,name=MTLSAuthId"` +} + +func (o *DeleteMtlsAuthWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *DeleteMtlsAuthWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *DeleteMtlsAuthWithConsumerRequest) GetMTLSAuthID() string { + if o == nil { + return "" + } + return o.MTLSAuthID +} + +type DeleteMtlsAuthWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *DeleteMtlsAuthWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteMtlsAuthWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteMtlsAuthWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/deletepluginwithconsumer.go b/models/operations/deletepluginwithconsumer.go new file mode 100644 index 0000000..1124b97 --- /dev/null +++ b/models/operations/deletepluginwithconsumer.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type DeletePluginWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // ID of the Plugin to lookup + PluginID string `pathParam:"style=simple,explode=false,name=PluginId"` +} + +func (o *DeletePluginWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *DeletePluginWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *DeletePluginWithConsumerRequest) GetPluginID() string { + if o == nil { + return "" + } + return o.PluginID +} + +type DeletePluginWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *DeletePluginWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeletePluginWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeletePluginWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/deletepluginwithconsumergroup.go b/models/operations/deletepluginwithconsumergroup.go new file mode 100644 index 0000000..5dadee5 --- /dev/null +++ b/models/operations/deletepluginwithconsumergroup.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type DeletePluginWithConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // ID of the Consumer Group to lookup + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` + // ID of the Plugin to lookup + PluginID string `pathParam:"style=simple,explode=false,name=PluginId"` +} + +func (o *DeletePluginWithConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *DeletePluginWithConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +func (o *DeletePluginWithConsumerGroupRequest) GetPluginID() string { + if o == nil { + return "" + } + return o.PluginID +} + +type DeletePluginWithConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *DeletePluginWithConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeletePluginWithConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeletePluginWithConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getconsumer.go b/models/operations/getconsumer.go index 36110bf..cc3b20f 100644 --- a/models/operations/getconsumer.go +++ b/models/operations/getconsumer.go @@ -8,7 +8,7 @@ import ( ) type GetConsumerRequest struct { - // ID of the Consumer to lookup + // The UUID of the consumer. ConsumerID string `pathParam:"style=simple,explode=false,name=ConsumerId"` // The UUID of your control plane. This variable is available in the Konnect manager. ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` diff --git a/models/operations/getexpectedconfighash.go b/models/operations/getexpectedconfighash.go index eb262ea..0b027e0 100644 --- a/models/operations/getexpectedconfighash.go +++ b/models/operations/getexpectedconfighash.go @@ -27,7 +27,7 @@ type GetExpectedConfigHashResponse struct { // Raw HTTP response; suitable for custom response parsing RawResponse *http.Response // Response body for retrieving the expected config hash of the control plane. - GetExpectedConfigHash *components.GetExpectedConfigHash + GetExpectedConfigHashResponse *components.GetExpectedConfigHashResponse } func (o *GetExpectedConfigHashResponse) GetContentType() string { @@ -51,9 +51,9 @@ func (o *GetExpectedConfigHashResponse) GetRawResponse() *http.Response { return o.RawResponse } -func (o *GetExpectedConfigHashResponse) GetGetExpectedConfigHash() *components.GetExpectedConfigHash { +func (o *GetExpectedConfigHashResponse) GetGetExpectedConfigHashResponse() *components.GetExpectedConfigHashResponse { if o == nil { return nil } - return o.GetExpectedConfigHash + return o.GetExpectedConfigHashResponse } diff --git a/models/operations/getmtlsauthwithconsumer.go b/models/operations/getmtlsauthwithconsumer.go new file mode 100644 index 0000000..f5c5ea1 --- /dev/null +++ b/models/operations/getmtlsauthwithconsumer.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type GetMtlsAuthWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // ID of the MTLS-auth credential to lookup + MTLSAuthID string `pathParam:"style=simple,explode=false,name=MTLSAuthId"` +} + +func (o *GetMtlsAuthWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *GetMtlsAuthWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *GetMtlsAuthWithConsumerRequest) GetMTLSAuthID() string { + if o == nil { + return "" + } + return o.MTLSAuthID +} + +type GetMtlsAuthWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully fetched MTLS-auth credential + MTLSAuth *components.MTLSAuth +} + +func (o *GetMtlsAuthWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetMtlsAuthWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetMtlsAuthWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetMtlsAuthWithConsumerResponse) GetMTLSAuth() *components.MTLSAuth { + if o == nil { + return nil + } + return o.MTLSAuth +} diff --git a/models/operations/getpluginwithconsumer.go b/models/operations/getpluginwithconsumer.go new file mode 100644 index 0000000..1f36c81 --- /dev/null +++ b/models/operations/getpluginwithconsumer.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type GetPluginWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // ID of the Plugin to lookup + PluginID string `pathParam:"style=simple,explode=false,name=PluginId"` +} + +func (o *GetPluginWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *GetPluginWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *GetPluginWithConsumerRequest) GetPluginID() string { + if o == nil { + return "" + } + return o.PluginID +} + +type GetPluginWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully fetched Plugin + Plugin *components.Plugin +} + +func (o *GetPluginWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPluginWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPluginWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetPluginWithConsumerResponse) GetPlugin() *components.Plugin { + if o == nil { + return nil + } + return o.Plugin +} diff --git a/models/operations/getpluginwithconsumergroup.go b/models/operations/getpluginwithconsumergroup.go new file mode 100644 index 0000000..29b32a3 --- /dev/null +++ b/models/operations/getpluginwithconsumergroup.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type GetPluginWithConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // ID of the Consumer Group to lookup + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` + // ID of the Plugin to lookup + PluginID string `pathParam:"style=simple,explode=false,name=PluginId"` +} + +func (o *GetPluginWithConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *GetPluginWithConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +func (o *GetPluginWithConsumerGroupRequest) GetPluginID() string { + if o == nil { + return "" + } + return o.PluginID +} + +type GetPluginWithConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully fetched Plugin + Plugin *components.Plugin +} + +func (o *GetPluginWithConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPluginWithConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPluginWithConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetPluginWithConsumerGroupResponse) GetPlugin() *components.Plugin { + if o == nil { + return nil + } + return o.Plugin +} diff --git a/models/operations/listconsumergroupsforconsumer.go b/models/operations/listconsumergroupsforconsumer.go index a0daa5e..ea06add 100644 --- a/models/operations/listconsumergroupsforconsumer.go +++ b/models/operations/listconsumergroupsforconsumer.go @@ -11,7 +11,7 @@ import ( type ListConsumerGroupsForConsumerRequest struct { // The UUID of your control plane. This variable is available in the Konnect manager. ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` - // ID of the Consumer to lookup + // The UUID of the consumer. ConsumerID string `pathParam:"style=simple,explode=false,name=ConsumerId"` // Number of resources to be returned. Size *int64 `default:"100" queryParam:"style=form,explode=true,name=size"` diff --git a/models/operations/listconsumersforconsumergroup.go b/models/operations/listconsumersforconsumergroup.go new file mode 100644 index 0000000..c7890c0 --- /dev/null +++ b/models/operations/listconsumersforconsumergroup.go @@ -0,0 +1,136 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/internal/utils" + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type ListConsumersForConsumerGroupRequest struct { + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Number of resources to be returned. + Size *int64 `default:"100" queryParam:"style=form,explode=true,name=size"` + // Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources + Offset *string `queryParam:"style=form,explode=true,name=offset"` + // A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. + Tags *string `queryParam:"style=form,explode=true,name=tags"` +} + +func (l ListConsumersForConsumerGroupRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListConsumersForConsumerGroupRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListConsumersForConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +func (o *ListConsumersForConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *ListConsumersForConsumerGroupRequest) GetSize() *int64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *ListConsumersForConsumerGroupRequest) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +func (o *ListConsumersForConsumerGroupRequest) GetTags() *string { + if o == nil { + return nil + } + return o.Tags +} + +// ListConsumersForConsumerGroupResponseBody - A successful response listing of consumers +type ListConsumersForConsumerGroupResponseBody struct { + Data []components.Consumer `json:"data,omitempty"` + // URI to the next page (may be null) + Next *string `json:"next,omitempty"` + // Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page + Offset *string `json:"offset,omitempty"` +} + +func (o *ListConsumersForConsumerGroupResponseBody) GetData() []components.Consumer { + if o == nil { + return nil + } + return o.Data +} + +func (o *ListConsumersForConsumerGroupResponseBody) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListConsumersForConsumerGroupResponseBody) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +type ListConsumersForConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // A successful response listing of consumers + Object *ListConsumersForConsumerGroupResponseBody +} + +func (o *ListConsumersForConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListConsumersForConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListConsumersForConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListConsumersForConsumerGroupResponse) GetObject() *ListConsumersForConsumerGroupResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/listmtlsauth.go b/models/operations/listmtlsauth.go new file mode 100644 index 0000000..23468e1 --- /dev/null +++ b/models/operations/listmtlsauth.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/internal/utils" + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type ListMtlsAuthRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Number of resources to be returned. + Size *int64 `default:"100" queryParam:"style=form,explode=true,name=size"` + // Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources + Offset *string `queryParam:"style=form,explode=true,name=offset"` + // A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. + Tags *string `queryParam:"style=form,explode=true,name=tags"` +} + +func (l ListMtlsAuthRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListMtlsAuthRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListMtlsAuthRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *ListMtlsAuthRequest) GetSize() *int64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *ListMtlsAuthRequest) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +func (o *ListMtlsAuthRequest) GetTags() *string { + if o == nil { + return nil + } + return o.Tags +} + +// ListMtlsAuthResponseBody - A successful response listing MTLS-auth credentials +type ListMtlsAuthResponseBody struct { + Data []components.MTLSAuth `json:"data,omitempty"` + // URI to the next page (may be null) + Next *string `json:"next,omitempty"` + // Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page + Offset *string `json:"offset,omitempty"` +} + +func (o *ListMtlsAuthResponseBody) GetData() []components.MTLSAuth { + if o == nil { + return nil + } + return o.Data +} + +func (o *ListMtlsAuthResponseBody) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListMtlsAuthResponseBody) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +type ListMtlsAuthResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // A successful response listing MTLS-auth credentials + Object *ListMtlsAuthResponseBody +} + +func (o *ListMtlsAuthResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListMtlsAuthResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListMtlsAuthResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListMtlsAuthResponse) GetObject() *ListMtlsAuthResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/listmtlsauthwithconsumer.go b/models/operations/listmtlsauthwithconsumer.go new file mode 100644 index 0000000..2cdb842 --- /dev/null +++ b/models/operations/listmtlsauthwithconsumer.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/internal/utils" + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type ListMtlsAuthWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // Number of resources to be returned. + Size *int64 `default:"100" queryParam:"style=form,explode=true,name=size"` + // Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources + Offset *string `queryParam:"style=form,explode=true,name=offset"` + // A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. + Tags *string `queryParam:"style=form,explode=true,name=tags"` +} + +func (l ListMtlsAuthWithConsumerRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListMtlsAuthWithConsumerRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListMtlsAuthWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *ListMtlsAuthWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *ListMtlsAuthWithConsumerRequest) GetSize() *int64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *ListMtlsAuthWithConsumerRequest) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +func (o *ListMtlsAuthWithConsumerRequest) GetTags() *string { + if o == nil { + return nil + } + return o.Tags +} + +// ListMtlsAuthWithConsumerResponseBody - A successful response listing MTLS-auth credentials +type ListMtlsAuthWithConsumerResponseBody struct { + Data []components.MTLSAuth `json:"data,omitempty"` + // URI to the next page (may be null) + Next *string `json:"next,omitempty"` + // Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page + Offset *string `json:"offset,omitempty"` +} + +func (o *ListMtlsAuthWithConsumerResponseBody) GetData() []components.MTLSAuth { + if o == nil { + return nil + } + return o.Data +} + +func (o *ListMtlsAuthWithConsumerResponseBody) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListMtlsAuthWithConsumerResponseBody) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +type ListMtlsAuthWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // A successful response listing MTLS-auth credentials + Object *ListMtlsAuthWithConsumerResponseBody +} + +func (o *ListMtlsAuthWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListMtlsAuthWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListMtlsAuthWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListMtlsAuthWithConsumerResponse) GetObject() *ListMtlsAuthWithConsumerResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/listpluginwithconsumer.go b/models/operations/listpluginwithconsumer.go new file mode 100644 index 0000000..be1f711 --- /dev/null +++ b/models/operations/listpluginwithconsumer.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/internal/utils" + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type ListPluginWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // Number of resources to be returned. + Size *int64 `default:"100" queryParam:"style=form,explode=true,name=size"` + // Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources + Offset *string `queryParam:"style=form,explode=true,name=offset"` + // A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. + Tags *string `queryParam:"style=form,explode=true,name=tags"` +} + +func (l ListPluginWithConsumerRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPluginWithConsumerRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListPluginWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *ListPluginWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *ListPluginWithConsumerRequest) GetSize() *int64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *ListPluginWithConsumerRequest) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +func (o *ListPluginWithConsumerRequest) GetTags() *string { + if o == nil { + return nil + } + return o.Tags +} + +// ListPluginWithConsumerResponseBody - A successful response listing Plugins +type ListPluginWithConsumerResponseBody struct { + Data []components.Plugin `json:"data,omitempty"` + // URI to the next page (may be null) + Next *string `json:"next,omitempty"` + // Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page + Offset *string `json:"offset,omitempty"` +} + +func (o *ListPluginWithConsumerResponseBody) GetData() []components.Plugin { + if o == nil { + return nil + } + return o.Data +} + +func (o *ListPluginWithConsumerResponseBody) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListPluginWithConsumerResponseBody) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +type ListPluginWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // A successful response listing Plugins + Object *ListPluginWithConsumerResponseBody +} + +func (o *ListPluginWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListPluginWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListPluginWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListPluginWithConsumerResponse) GetObject() *ListPluginWithConsumerResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/listpluginwithconsumergroup.go b/models/operations/listpluginwithconsumergroup.go new file mode 100644 index 0000000..c4c1981 --- /dev/null +++ b/models/operations/listpluginwithconsumergroup.go @@ -0,0 +1,137 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/internal/utils" + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type ListPluginWithConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // ID of the Consumer Group to lookup + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` + // Number of resources to be returned. + Size *int64 `default:"100" queryParam:"style=form,explode=true,name=size"` + // Offset from which to return the next set of resources. Use the value of the 'offset' field from the response of a list operation as input here to paginate through all the resources + Offset *string `queryParam:"style=form,explode=true,name=offset"` + // A list of tags to filter the list of resources on. Multiple tags can be concatenated using ',' to mean AND or using '/' to mean OR. + Tags *string `queryParam:"style=form,explode=true,name=tags"` +} + +func (l ListPluginWithConsumerGroupRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(l, "", false) +} + +func (l *ListPluginWithConsumerGroupRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &l, "", false, false); err != nil { + return err + } + return nil +} + +func (o *ListPluginWithConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *ListPluginWithConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +func (o *ListPluginWithConsumerGroupRequest) GetSize() *int64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *ListPluginWithConsumerGroupRequest) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +func (o *ListPluginWithConsumerGroupRequest) GetTags() *string { + if o == nil { + return nil + } + return o.Tags +} + +// ListPluginWithConsumerGroupResponseBody - A successful response listing Plugins +type ListPluginWithConsumerGroupResponseBody struct { + Data []components.Plugin `json:"data,omitempty"` + // URI to the next page (may be null) + Next *string `json:"next,omitempty"` + // Offset is used to paginate through the API. Provide this value to the next list operation to fetch the next page + Offset *string `json:"offset,omitempty"` +} + +func (o *ListPluginWithConsumerGroupResponseBody) GetData() []components.Plugin { + if o == nil { + return nil + } + return o.Data +} + +func (o *ListPluginWithConsumerGroupResponseBody) GetNext() *string { + if o == nil { + return nil + } + return o.Next +} + +func (o *ListPluginWithConsumerGroupResponseBody) GetOffset() *string { + if o == nil { + return nil + } + return o.Offset +} + +type ListPluginWithConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // A successful response listing Plugins + Object *ListPluginWithConsumerGroupResponseBody +} + +func (o *ListPluginWithConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ListPluginWithConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ListPluginWithConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *ListPluginWithConsumerGroupResponse) GetObject() *ListPluginWithConsumerGroupResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/removeconsumerfromconsumergroup.go b/models/operations/removeconsumerfromconsumergroup.go new file mode 100644 index 0000000..89a21df --- /dev/null +++ b/models/operations/removeconsumerfromconsumergroup.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type RemoveConsumerFromConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // The UUID of the consumer. + ConsumerID string `pathParam:"style=simple,explode=false,name=ConsumerId"` + // ID of the Consumer Group to lookup + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` +} + +func (o *RemoveConsumerFromConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *RemoveConsumerFromConsumerGroupRequest) GetConsumerID() string { + if o == nil { + return "" + } + return o.ConsumerID +} + +func (o *RemoveConsumerFromConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +type RemoveConsumerFromConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *RemoveConsumerFromConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *RemoveConsumerFromConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *RemoveConsumerFromConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/upsertconsumer.go b/models/operations/upsertconsumer.go index 0a3a9ed..1c7daa0 100644 --- a/models/operations/upsertconsumer.go +++ b/models/operations/upsertconsumer.go @@ -8,7 +8,7 @@ import ( ) type UpsertConsumerRequest struct { - // ID of the Consumer to lookup + // The UUID of the consumer. ConsumerID string `pathParam:"style=simple,explode=false,name=ConsumerId"` // The UUID of your control plane. This variable is available in the Konnect manager. ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` diff --git a/models/operations/upsertmtlsauthwithconsumer.go b/models/operations/upsertmtlsauthwithconsumer.go new file mode 100644 index 0000000..14697ee --- /dev/null +++ b/models/operations/upsertmtlsauthwithconsumer.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type UpsertMtlsAuthWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // ID of the MTLS-auth credential to lookup + MTLSAuthID string `pathParam:"style=simple,explode=false,name=MTLSAuthId"` + // Description of the MTLS-auth credential + MTLSAuthWithoutParents components.MTLSAuthWithoutParents `request:"mediaType=application/json"` +} + +func (o *UpsertMtlsAuthWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *UpsertMtlsAuthWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *UpsertMtlsAuthWithConsumerRequest) GetMTLSAuthID() string { + if o == nil { + return "" + } + return o.MTLSAuthID +} + +func (o *UpsertMtlsAuthWithConsumerRequest) GetMTLSAuthWithoutParents() components.MTLSAuthWithoutParents { + if o == nil { + return components.MTLSAuthWithoutParents{} + } + return o.MTLSAuthWithoutParents +} + +type UpsertMtlsAuthWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully upserted MTLS-auth credential + MTLSAuth *components.MTLSAuth +} + +func (o *UpsertMtlsAuthWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpsertMtlsAuthWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpsertMtlsAuthWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *UpsertMtlsAuthWithConsumerResponse) GetMTLSAuth() *components.MTLSAuth { + if o == nil { + return nil + } + return o.MTLSAuth +} diff --git a/models/operations/upsertpluginwithconsumer.go b/models/operations/upsertpluginwithconsumer.go new file mode 100644 index 0000000..3349b67 --- /dev/null +++ b/models/operations/upsertpluginwithconsumer.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type UpsertPluginWithConsumerRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // Consumer ID for nested entities + ConsumerIDForNestedEntities string `pathParam:"style=simple,explode=false,name=ConsumerIdForNestedEntities"` + // ID of the Plugin to lookup + PluginID string `pathParam:"style=simple,explode=false,name=PluginId"` + // Description of the Plugin + PluginWithoutParents components.PluginWithoutParents `request:"mediaType=application/json"` +} + +func (o *UpsertPluginWithConsumerRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *UpsertPluginWithConsumerRequest) GetConsumerIDForNestedEntities() string { + if o == nil { + return "" + } + return o.ConsumerIDForNestedEntities +} + +func (o *UpsertPluginWithConsumerRequest) GetPluginID() string { + if o == nil { + return "" + } + return o.PluginID +} + +func (o *UpsertPluginWithConsumerRequest) GetPluginWithoutParents() components.PluginWithoutParents { + if o == nil { + return components.PluginWithoutParents{} + } + return o.PluginWithoutParents +} + +type UpsertPluginWithConsumerResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully upserted Plugin + Plugin *components.Plugin +} + +func (o *UpsertPluginWithConsumerResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpsertPluginWithConsumerResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpsertPluginWithConsumerResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *UpsertPluginWithConsumerResponse) GetPlugin() *components.Plugin { + if o == nil { + return nil + } + return o.Plugin +} diff --git a/models/operations/upsertpluginwithconsumergroup.go b/models/operations/upsertpluginwithconsumergroup.go new file mode 100644 index 0000000..c9a72bb --- /dev/null +++ b/models/operations/upsertpluginwithconsumergroup.go @@ -0,0 +1,86 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package operations + +import ( + "github.com/Kong/sdk-konnect-go/models/components" + "net/http" +) + +type UpsertPluginWithConsumerGroupRequest struct { + // The UUID of your control plane. This variable is available in the Konnect manager. + ControlPlaneID string `pathParam:"style=simple,explode=false,name=controlPlaneId"` + // ID of the Consumer Group to lookup + ConsumerGroupID string `pathParam:"style=simple,explode=false,name=ConsumerGroupId"` + // ID of the Plugin to lookup + PluginID string `pathParam:"style=simple,explode=false,name=PluginId"` + // Description of the Plugin + PluginWithoutParents components.PluginWithoutParents `request:"mediaType=application/json"` +} + +func (o *UpsertPluginWithConsumerGroupRequest) GetControlPlaneID() string { + if o == nil { + return "" + } + return o.ControlPlaneID +} + +func (o *UpsertPluginWithConsumerGroupRequest) GetConsumerGroupID() string { + if o == nil { + return "" + } + return o.ConsumerGroupID +} + +func (o *UpsertPluginWithConsumerGroupRequest) GetPluginID() string { + if o == nil { + return "" + } + return o.PluginID +} + +func (o *UpsertPluginWithConsumerGroupRequest) GetPluginWithoutParents() components.PluginWithoutParents { + if o == nil { + return components.PluginWithoutParents{} + } + return o.PluginWithoutParents +} + +type UpsertPluginWithConsumerGroupResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Successfully upserted Plugin + Plugin *components.Plugin +} + +func (o *UpsertPluginWithConsumerGroupResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpsertPluginWithConsumerGroupResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpsertPluginWithConsumerGroupResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *UpsertPluginWithConsumerGroupResponse) GetPlugin() *components.Plugin { + if o == nil { + return nil + } + return o.Plugin +} diff --git a/mtlsauthcredentials.go b/mtlsauthcredentials.go new file mode 100644 index 0000000..4ef73d4 --- /dev/null +++ b/mtlsauthcredentials.go @@ -0,0 +1,1147 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +package sdkkonnectgo + +import ( + "bytes" + "context" + "fmt" + "github.com/Kong/sdk-konnect-go/internal/hooks" + "github.com/Kong/sdk-konnect-go/internal/utils" + "github.com/Kong/sdk-konnect-go/models/components" + "github.com/Kong/sdk-konnect-go/models/operations" + "github.com/Kong/sdk-konnect-go/models/sdkerrors" + "github.com/cenkalti/backoff/v4" + "net/http" +) + +type MTLSAuthCredentials struct { + sdkConfiguration sdkConfiguration +} + +func newMTLSAuthCredentials(sdkConfig sdkConfiguration) *MTLSAuthCredentials { + return &MTLSAuthCredentials{ + sdkConfiguration: sdkConfig, + } +} + +// ListMtlsAuthWithConsumer - List all MTLS-auth credentials associated with a Consumer +// List all MTLS-auth credentials associated with a Consumer +func (s *MTLSAuthCredentials) ListMtlsAuthWithConsumer(ctx context.Context, request operations.ListMtlsAuthWithConsumerRequest, opts ...operations.Option) (*operations.ListMtlsAuthWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-mtls-auth-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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); 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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListMtlsAuthWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.ListMtlsAuthWithConsumerResponseBody + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreateMtlsAuthWithConsumer - Create a new MTLS-auth credential associated with a Consumer +// Create a new MTLS-auth credential associated with a Consumer +func (s *MTLSAuthCredentials) CreateMtlsAuthWithConsumer(ctx context.Context, request operations.CreateMtlsAuthWithConsumerRequest, opts ...operations.Option) (*operations.CreateMtlsAuthWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-mtls-auth-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MTLSAuthWithoutParents", "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, "POST", 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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreateMtlsAuthWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + 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.MTLSAuth + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MTLSAuth = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeleteMtlsAuthWithConsumer - Delete a a MTLS-auth credential associated with a Consumer +// Delete a a MTLS-auth credential associated with a Consumer using ID. +func (s *MTLSAuthCredentials) DeleteMtlsAuthWithConsumer(ctx context.Context, request operations.DeleteMtlsAuthWithConsumerRequest, opts ...operations.Option) (*operations.DeleteMtlsAuthWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "delete-mtls-auth-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeleteMtlsAuthWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetMtlsAuthWithConsumer - Fetch a MTLS-auth credential associated with a Consumer +// Get a MTLS-auth credential associated with a Consumer using ID. +func (s *MTLSAuthCredentials) GetMtlsAuthWithConsumer(ctx context.Context, request operations.GetMtlsAuthWithConsumerRequest, opts ...operations.Option) (*operations.GetMtlsAuthWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-mtls-auth-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetMtlsAuthWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.MTLSAuth + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MTLSAuth = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(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: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpsertMtlsAuthWithConsumer - Upsert a MTLS-auth credential associated with a Consumer +// Create or Update a MTLS-auth credential associated with a Consumer using ID. +func (s *MTLSAuthCredentials) UpsertMtlsAuthWithConsumer(ctx context.Context, request operations.UpsertMtlsAuthWithConsumerRequest, opts ...operations.Option) (*operations.UpsertMtlsAuthWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "upsert-mtls-auth-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MTLSAuthWithoutParents", "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, "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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpsertMtlsAuthWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.MTLSAuth + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MTLSAuth = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListMtlsAuth - List all MTLS-auth credentials +// List all MTLS-auth credentials +func (s *MTLSAuthCredentials) ListMtlsAuth(ctx context.Context, request operations.ListMtlsAuthRequest, opts ...operations.Option) (*operations.ListMtlsAuthResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-mtls-auth", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/mtls-auths", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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); 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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"401", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListMtlsAuthResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.ListMtlsAuthResponseBody + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.GatewayUnauthorizedError + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} diff --git a/openapi.yaml b/openapi.yaml index 5148692..607cbd5 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -569,6 +569,32 @@ paths: tags: - Consumer Groups /v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/consumers: + get: + operationId: list-consumers-for-consumer-group + summary: List all Consumers in a Consumer Group + description: List all consumers in a consumer group + parameters: + - $ref: '#/components/parameters/PaginationSize' + - $ref: '#/components/parameters/PaginationOffset' + - $ref: '#/components/parameters/PaginationTagsFilter' + responses: + '200': + description: A successful response listing of consumers + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Consumer' + next: + $ref: '#/components/schemas/PaginationNextResponse' + offset: + $ref: '#/components/schemas/PaginationOffsetResponse' + tags: + - Consumer Groups parameters: - $ref: '#/components/parameters/ConsumerGroupIdManageConsumers' - $ref: '#/components/parameters/controlPlaneId' @@ -622,6 +648,114 @@ paths: schema: type: string - $ref: '#/components/parameters/controlPlaneId' + /v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins: + get: + operationId: list-plugin-with-consumer_group + summary: List all Plugins associated with a Consumer Group + description: List all Plugins associated with a Consumer Group + parameters: + - $ref: '#/components/parameters/ConsumerGroupId' + - $ref: '#/components/parameters/PaginationSize' + - $ref: '#/components/parameters/PaginationOffset' + - $ref: '#/components/parameters/PaginationTagsFilter' + responses: + '200': + description: A successful response listing Plugins + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Plugin' + next: + $ref: '#/components/schemas/PaginationNextResponse' + offset: + $ref: '#/components/schemas/PaginationOffsetResponse' + tags: + - Plugins + parameters: + - $ref: '#/components/parameters/controlPlaneId' + post: + operationId: create-plugin-with-consumer_group + summary: Create a new Plugin associated with a Consumer Group + description: Create a new Plugin associated with a Consumer Group + parameters: + - $ref: '#/components/parameters/ConsumerGroupId' + requestBody: + description: Description of new Plugin for creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PluginWithoutParents' + responses: + '201': + description: Successfully created Plugin + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + tags: + - Plugins + /v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}: + delete: + operationId: delete-plugin-with-consumer_group + summary: Delete a a Plugin associated with a Consumer Group + description: Delete a a Plugin associated with a Consumer Group using ID. + parameters: + - $ref: '#/components/parameters/ConsumerGroupId' + - $ref: '#/components/parameters/PluginId' + responses: + '204': + description: Successfully deleted Plugin or the resource didn't exist + tags: + - Plugins + get: + operationId: get-plugin-with-consumer_group + summary: Fetch a Plugin associated with a Consumer Group + description: Get a Plugin associated with a Consumer Group using ID. + parameters: + - $ref: '#/components/parameters/ConsumerGroupId' + - $ref: '#/components/parameters/PluginId' + responses: + '200': + description: Successfully fetched Plugin + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + '404': + description: Resource does not exist + tags: + - Plugins + parameters: + - $ref: '#/components/parameters/controlPlaneId' + put: + operationId: upsert-plugin-with-consumer_group + summary: Upsert a Plugin associated with a Consumer Group + description: Create or Update a Plugin associated with a Consumer Group using ID. + parameters: + - $ref: '#/components/parameters/ConsumerGroupId' + - $ref: '#/components/parameters/PluginId' + requestBody: + description: Description of the Plugin + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PluginWithoutParents' + responses: + '200': + description: Successfully upserted Plugin + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + tags: + - Plugins /v2/control-planes/{controlPlaneId}/core-entities/consumers: get: operationId: list-consumer @@ -761,6 +895,55 @@ paths: - Consumer Groups parameters: - $ref: '#/components/parameters/controlPlaneId' + post: + operationId: add-consumer-to-specific-consumer-group + summary: Add consumer to a specific consumer group + description: Add a consumer to a consumer group + parameters: + - $ref: '#/components/parameters/ConsumerId' + requestBody: + content: + application/json: + schema: + type: object + properties: + group: + type: string + example: fedee695-2ae2-4e45-877a-776d9b2fc793 + x-speakeasy-name-override: group + responses: + '201': + description: Consumer added to a specific group + content: + application/json: + schema: + type: object + properties: + consumer: + $ref: '#/components/schemas/Consumer' + consumer_groups: + type: array + items: + $ref: '#/components/schemas/ConsumerGroup' + tags: + - Consumer Groups + /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups/{ConsumerGroupId}: + delete: + operationId: remove-consumer-from-consumer-group + summary: Remove consumer from consumer group + description: >- + Removes a consumer from a consumer group. This operation does not delete + the consumer group. + parameters: + - $ref: '#/components/parameters/ConsumerId' + - $ref: '#/components/parameters/ConsumerGroupId' + responses: + '204': + description: Consumer removed from group + tags: + - Consumer Groups + parameters: + - $ref: '#/components/parameters/controlPlaneId' /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/acls: get: operationId: list-acl-with-consumer @@ -1309,6 +1492,226 @@ paths: $ref: '#/components/schemas/KeyAuth' tags: - API-keys + /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth: + get: + operationId: list-mtls-auth-with-consumer + summary: List all MTLS-auth credentials associated with a Consumer + description: List all MTLS-auth credentials associated with a Consumer + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/PaginationSize' + - $ref: '#/components/parameters/PaginationOffset' + - $ref: '#/components/parameters/PaginationTagsFilter' + responses: + '200': + description: A successful response listing MTLS-auth credentials + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/MTLSAuth' + next: + $ref: '#/components/schemas/PaginationNextResponse' + offset: + $ref: '#/components/schemas/PaginationOffsetResponse' + tags: + - MTLS-auth credentials + parameters: + - $ref: '#/components/parameters/controlPlaneId' + post: + operationId: create-mtls-auth-with-consumer + summary: Create a new MTLS-auth credential associated with a Consumer + description: Create a new MTLS-auth credential associated with a Consumer + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + requestBody: + description: Description of new MTLS-auth credential for creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MTLSAuthWithoutParents' + responses: + '201': + description: Successfully created MTLS-auth credential + content: + application/json: + schema: + $ref: '#/components/schemas/MTLSAuth' + tags: + - MTLS-auth credentials + /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}: + delete: + operationId: delete-mtls-auth-with-consumer + summary: Delete a a MTLS-auth credential associated with a Consumer + description: Delete a a MTLS-auth credential associated with a Consumer using ID. + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/MTLSAuthId' + responses: + '204': + description: >- + Successfully deleted MTLS-auth credential or the resource didn't + exist + tags: + - MTLS-auth credentials + get: + operationId: get-mtls-auth-with-consumer + summary: Fetch a MTLS-auth credential associated with a Consumer + description: Get a MTLS-auth credential associated with a Consumer using ID. + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/MTLSAuthId' + responses: + '200': + description: Successfully fetched MTLS-auth credential + content: + application/json: + schema: + $ref: '#/components/schemas/MTLSAuth' + '404': + description: Resource does not exist + tags: + - MTLS-auth credentials + parameters: + - $ref: '#/components/parameters/controlPlaneId' + put: + operationId: upsert-mtls-auth-with-consumer + summary: Upsert a MTLS-auth credential associated with a Consumer + description: >- + Create or Update a MTLS-auth credential associated with a Consumer using + ID. + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/MTLSAuthId' + requestBody: + description: Description of the MTLS-auth credential + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MTLSAuthWithoutParents' + responses: + '200': + description: Successfully upserted MTLS-auth credential + content: + application/json: + schema: + $ref: '#/components/schemas/MTLSAuth' + tags: + - MTLS-auth credentials + /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins: + get: + operationId: list-plugin-with-consumer + summary: List all Plugins associated with a Consumer + description: List all Plugins associated with a Consumer + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/PaginationSize' + - $ref: '#/components/parameters/PaginationOffset' + - $ref: '#/components/parameters/PaginationTagsFilter' + responses: + '200': + description: A successful response listing Plugins + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Plugin' + next: + $ref: '#/components/schemas/PaginationNextResponse' + offset: + $ref: '#/components/schemas/PaginationOffsetResponse' + tags: + - Plugins + parameters: + - $ref: '#/components/parameters/controlPlaneId' + post: + operationId: create-plugin-with-consumer + summary: Create a new Plugin associated with a Consumer + description: Create a new Plugin associated with a Consumer + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + requestBody: + description: Description of new Plugin for creation + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PluginWithoutParents' + responses: + '201': + description: Successfully created Plugin + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + tags: + - Plugins + /v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}: + delete: + operationId: delete-plugin-with-consumer + summary: Delete a a Plugin associated with a Consumer + description: Delete a a Plugin associated with a Consumer using ID. + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/PluginId' + responses: + '204': + description: Successfully deleted Plugin or the resource didn't exist + tags: + - Plugins + get: + operationId: get-plugin-with-consumer + summary: Fetch a Plugin associated with a Consumer + description: Get a Plugin associated with a Consumer using ID. + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/PluginId' + responses: + '200': + description: Successfully fetched Plugin + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + '404': + description: Resource does not exist + tags: + - Plugins + parameters: + - $ref: '#/components/parameters/controlPlaneId' + put: + operationId: upsert-plugin-with-consumer + summary: Upsert a Plugin associated with a Consumer + description: Create or Update a Plugin associated with a Consumer using ID. + parameters: + - $ref: '#/components/parameters/ConsumerIdForNestedEntities' + - $ref: '#/components/parameters/PluginId' + requestBody: + description: Description of the Plugin + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PluginWithoutParents' + responses: + '200': + description: Successfully upserted Plugin + content: + application/json: + schema: + $ref: '#/components/schemas/Plugin' + tags: + - Plugins /v2/control-planes/{controlPlaneId}/core-entities/hmac-auths: get: operationId: list-hmac-auth @@ -1728,6 +2131,37 @@ paths: $ref: '#/components/responses/HTTP401Error' tags: - Keys + /v2/control-planes/{controlPlaneId}/core-entities/mtls-auths: + get: + operationId: list-mtls-auth + summary: List all MTLS-auth credentials + description: List all MTLS-auth credentials + parameters: + - $ref: '#/components/parameters/PaginationSize' + - $ref: '#/components/parameters/PaginationOffset' + - $ref: '#/components/parameters/PaginationTagsFilter' + responses: + '200': + description: A successful response listing MTLS-auth credentials + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/MTLSAuth' + next: + $ref: '#/components/schemas/PaginationNextResponse' + offset: + $ref: '#/components/schemas/PaginationOffsetResponse' + '401': + $ref: '#/components/responses/HTTP401Error' + tags: + - MTLS-auth credentials + parameters: + - $ref: '#/components/parameters/controlPlaneId' /v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas: parameters: - $ref: '#/components/parameters/controlPlaneId' @@ -3022,7 +3456,7 @@ paths: same if they are in sync. responses: '200': - $ref: '#/components/responses/get-expected-config-hash' + $ref: '#/components/responses/GetExpectedConfigHashResponse' tags: - DP Nodes parameters: @@ -3244,7 +3678,7 @@ paths: summary: Upsert Control Plane Group Members description: Adds one or more control planes as a member of a control plane group. requestBody: - $ref: '#/components/requestBodies/GroupMemebershipUpsert' + $ref: '#/components/requestBodies/GroupMembershipUpsert' responses: '204': description: No Content @@ -3274,7 +3708,7 @@ paths: summary: Add Control Plane Group Members description: Adds one or more control planes as a member of a control plane group. requestBody: - $ref: '#/components/requestBodies/GroupMemebershipAdd' + $ref: '#/components/requestBodies/GroupMembershipAdd' responses: '204': description: No Content @@ -4446,6 +4880,8 @@ paths: $ref: '#/components/responses/IdentityBadRequest' '404': $ref: '#/components/responses/IdentityNotFound' + '409': + $ref: '#/components/responses/IdentityConflict' servers: - url: https://global.api.konghq.com/ tags: @@ -4785,8 +5221,8 @@ components: type: string x-speakeasy-name-override: consumer_group_id ConsumerId: - description: ID of the Consumer to lookup - example: c1059869-6fa7-4329-a5f5-5946d14ca2c5 + description: The UUID of the consumer. + example: 123e4567-e89b-12d3-a456-426614174000 in: path name: ConsumerId required: true @@ -4872,6 +5308,14 @@ components: required: true schema: type: string + MTLSAuthId: + description: ID of the MTLS-auth credential to lookup + example: '' + in: path + name: MTLSAuthId + required: true + schema: + type: string PageAfter: name: page[after] description: >- @@ -5033,9 +5477,13 @@ components: type: array items: type: object + required: + - id properties: id: type: string + required: + - members CreateControlPlaneRequest: x-speakeasy-entity: GatewayControlPlane description: The request schema for the create control plane request. @@ -5157,7 +5605,6 @@ components: example: CLUSTER_TYPE_CONTROL_PLANE enum: - CLUSTER_TYPE_CONTROL_PLANE - - CLUSTER_TYPE_HYBRID - CLUSTER_TYPE_K8S_INGRESS_CONTROLLER - CLUSTER_TYPE_CONTROL_PLANE_GROUP - CLUSTER_TYPE_SERVERLESS @@ -5247,6 +5694,11 @@ components: - CONFLICT - UNKNOWN readOnly: true + required: + - id + - created_at + - updated_at + - state title: GroupStatus GroupConflict: description: >- @@ -5269,6 +5721,10 @@ components: readOnly: true resource: $ref: '#/components/schemas/GroupConflictResource' + required: + - cluster_id + - description + - resource title: GroupConflict GroupConflictResource: description: A resource causing a conflict in a control plane group. @@ -5528,7 +5984,6 @@ components: type: string enum: - required - - max_length - is_array - is_base64 - is_boolean @@ -5586,6 +6041,8 @@ components: - min_lowercase - min_uppercase - min_symbols + - min_items + - min nullable: false readOnly: true minimum: @@ -5596,7 +6053,7 @@ components: example: body reason: type: string - example: is a required field + example: must have at least 8 characters readOnly: true additionalProperties: false required: @@ -5604,6 +6061,38 @@ components: - reason - rule - minimum + InvalidParameterMaximumLength: + type: object + properties: + field: + type: string + example: name + readOnly: true + rule: + description: invalid parameters rules + type: string + enum: + - max_length + - max_items + - max + nullable: false + readOnly: true + maximum: + type: integer + example: 8 + source: + type: string + example: body + reason: + type: string + example: must not have more than 8 characters + readOnly: true + additionalProperties: false + required: + - field + - reason + - rule + - maximum InvalidParameterChoiceItem: type: object properties: @@ -5678,6 +6167,7 @@ components: oneOf: - $ref: '#/components/schemas/InvalidParameterStandard' - $ref: '#/components/schemas/InvalidParameterMinimumLength' + - $ref: '#/components/schemas/InvalidParameterMaximumLength' - $ref: '#/components/schemas/InvalidParameterChoiceItem' - $ref: '#/components/schemas/InvalidParameterDependentItem' minItems: 1 @@ -5808,10 +6298,6 @@ components: type: array items: type: string - default: - - email - - openid - - profile claim_mappings: type: object minProperties: 3 @@ -5819,15 +6305,12 @@ components: name: type: string example: name - default: name email: type: string example: email - default: email groups: type: string example: custom-groups-claim - default: groups title: IdP Configuration User: description: >- @@ -5861,7 +6344,6 @@ components: active: description: Returns True if a user has verified their email address. type: boolean - default: true readOnly: true created_at: description: The time stamp for the date the account was registered. @@ -5914,7 +6396,6 @@ components: teams that can manage Konnect objects, like "Organization Admin", or "Service" type: boolean - default: false readOnly: true labels: $ref: '#/components/schemas/Labels' @@ -6159,13 +6640,14 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer readOnly: true group: type: string - nullable: true id: type: string nullable: true @@ -6173,13 +6655,14 @@ components: type: array items: type: string - nullable: true example: consumer: id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f group: foo id: b1f34145-0343-41a4-9602-4c69dec2f269 additionalProperties: false + required: + - group ACLWithoutParents: type: object properties: @@ -6189,7 +6672,6 @@ components: readOnly: true group: type: string - nullable: true id: type: string nullable: true @@ -6197,11 +6679,12 @@ components: type: array items: type: string - nullable: true example: group: foo id: b1f34145-0343-41a4-9602-4c69dec2f269 additionalProperties: false + required: + - group BasicAuth: type: object properties: @@ -6213,6 +6696,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -6222,15 +6707,12 @@ components: nullable: true password: type: string - nullable: true tags: type: array items: type: string - nullable: true username: type: string - nullable: true example: consumer: id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f @@ -6238,6 +6720,9 @@ components: password: hashedsoopersecretvalue username: darius additionalProperties: false + required: + - username + - password BasicAuthWithoutParents: type: object properties: @@ -6250,20 +6735,20 @@ components: nullable: true password: type: string - nullable: true tags: type: array items: type: string - nullable: true username: type: string - nullable: true example: id: b2f34145-0343-41a4-9602-4c69dec2f269 password: hashedsoopersecretvalue username: darius additionalProperties: false + required: + - username + - password CACertificate: description: >- A CA certificate object represents a trusted CA. These objects are used @@ -6294,7 +6779,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6369,6 +6853,11 @@ components: format](/gateway/latest/plan-and-deploy/security/secrets-management/reference-format). type: string nullable: true + snis: + type: array + items: + type: string + nullable: true tags: description: >- An optional set of strings associated with the Certificate for @@ -6376,7 +6865,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6424,7 +6912,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6458,7 +6945,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6492,6 +6978,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -6506,10 +6994,8 @@ components: type: array items: type: string - nullable: true username: type: string - nullable: true example: consumer: id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f @@ -6517,6 +7003,8 @@ components: secret: wQazJ304DW5huJklHgUfjfiSyCyTAEDZ username: xerxes additionalProperties: false + required: + - username HMACAuthWithoutParents: type: object properties: @@ -6534,21 +7022,20 @@ components: type: array items: type: string - nullable: true username: type: string - nullable: true example: id: 75695322-e8a0-4109-aed4-5416b0308d85 secret: wQazJ304DW5huJklHgUfjfiSyCyTAEDZ username: xerxes additionalProperties: false + required: + - username JWT: type: object properties: algorithm: type: string - default: HS256 enum: - HS256 - HS384 @@ -6572,6 +7059,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -6592,7 +7081,6 @@ components: type: array items: type: string - nullable: true example: algorithm: HS256 consumer: @@ -6606,7 +7094,6 @@ components: properties: algorithm: type: string - default: HS256 enum: - HS256 - HS384 @@ -6642,7 +7129,6 @@ components: type: array items: type: string - nullable: true example: algorithm: HS256 id: 75695322-e8a0-4109-aed4-5416b0308d85 @@ -6692,6 +7178,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null tags: description: >- An optional set of strings associated with the Key for grouping and @@ -6699,7 +7187,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6728,6 +7215,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -6737,18 +7226,18 @@ components: nullable: true key: type: string - nullable: true tags: type: array items: type: string - nullable: true example: consumer: id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f id: b2f34145-0343-41a4-9602-4c69dec2f269 key: IL1deIyHyQA40WpeLeA1bIUXuvTwlGjo additionalProperties: false + required: + - key KeyAuthWithoutParents: type: object properties: @@ -6761,16 +7250,16 @@ components: nullable: true key: type: string - nullable: true tags: type: array items: type: string - nullable: true example: id: b2f34145-0343-41a4-9602-4c69dec2f269 key: IL1deIyHyQA40WpeLeA1bIUXuvTwlGjo additionalProperties: false + required: + - key KeySet: type: object properties: @@ -6788,7 +7277,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6842,6 +7330,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null tags: description: >- An optional set of strings associated with the Key for grouping and @@ -6849,7 +7339,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -6867,6 +7356,86 @@ components: additionalProperties: false required: - kid + MTLSAuth: + type: object + properties: + ca_certificate: + type: object + additionalProperties: false + nullable: true + properties: + id: + type: string + x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null + consumer: + type: object + additionalProperties: false + nullable: true + properties: + id: + type: string + x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null + created_at: + description: Unix epoch when the resource was created. + type: integer + readOnly: true + id: + type: string + nullable: true + subject_name: + type: string + tags: + type: array + items: + type: string + example: + ca_certificate: + id: b2f34145-0343-41a4-9602-4c69dec2f260 + consumer: + id: 84a73fb8-50fc-44a7-a4d5-aa17728ee83f + id: b2f34145-0343-41a4-9602-4c69dec2f269 + subject_name: CA_Subject_Name + additionalProperties: false + required: + - subject_name + MTLSAuthWithoutParents: + type: object + properties: + ca_certificate: + type: object + additionalProperties: false + nullable: true + properties: + id: + type: string + x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null + created_at: + description: Unix epoch when the resource was created. + type: integer + readOnly: true + id: + type: string + nullable: true + subject_name: + type: string + tags: + type: array + items: + type: string + example: + ca_certificate: + id: b2f34145-0343-41a4-9602-4c69dec2f260 + id: b2f34145-0343-41a4-9602-4c69dec2f269 + subject_name: CA_Subject_Name + additionalProperties: false + required: + - subject_name PaginationNextResponse: description: URI to the next page (may be null) type: string @@ -6910,6 +7479,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null consumer_group: type: object additionalProperties: false @@ -6918,6 +7489,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -6925,7 +7498,6 @@ components: enabled: description: Whether the plugin is applied. type: boolean - default: true nullable: true id: type: string @@ -6976,11 +7548,6 @@ components: - ws - wss type: string - default: - - grpc - - grpcs - - http - - https nullable: true route: description: >- @@ -6994,6 +7561,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null service: description: >- If set, the plugin will only activate when receiving requests via @@ -7006,6 +7575,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null tags: description: >- An optional set of strings associated with the Plugin for grouping @@ -7013,7 +7584,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -7069,7 +7639,6 @@ components: enabled: description: Whether the plugin is applied. type: boolean - default: true nullable: true id: type: string @@ -7120,11 +7689,6 @@ components: - ws - wss type: string - default: - - grpc - - grpcs - - http - - https nullable: true tags: description: >- @@ -7133,7 +7697,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -7219,7 +7782,6 @@ components: the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the `https` protocol. type: integer - default: 426 enum: - 426 - 301 @@ -7249,7 +7811,6 @@ components: combined when sending a request to the upstream. See above for a detailed description of each behavior. type: string - default: v0 enum: - v0 - v1 @@ -7267,7 +7828,6 @@ components: `false`, the upstream `Host` header will be that of the Service's `host`. type: boolean - default: false nullable: true protocols: description: >- @@ -7290,9 +7850,6 @@ components: - ws - wss type: string - default: - - http - - https nullable: true regex_priority: description: >- @@ -7303,7 +7860,6 @@ components: non-regex routes is different (longer non-regex routes are matched before shorter ones). type: integer - default: 0 nullable: true request_buffering: description: >- @@ -7311,7 +7867,6 @@ components: may make sense to turn this off on services that receive data with chunked transfer encoding. type: boolean - default: true nullable: true response_buffering: description: >- @@ -7319,7 +7874,6 @@ components: may make sense to turn this off on services that send data with chunked transfer encoding. type: boolean - default: true nullable: true service: description: >- @@ -7332,6 +7886,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null snis: description: A list of SNIs that match this Route when using stream routing. type: array @@ -7357,7 +7913,6 @@ components: When matching a Route via one of the `paths`, strip the matching prefix from the upstream request URL. type: boolean - default: true nullable: true tags: description: >- @@ -7366,7 +7921,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -7442,7 +7996,6 @@ components: the field is set to 301, 302, 307 or 308. Note: This config applies only if the Route is configured to only accept the `https` protocol. type: integer - default: 426 enum: - 426 - 301 @@ -7472,7 +8025,6 @@ components: combined when sending a request to the upstream. See above for a detailed description of each behavior. type: string - default: v0 enum: - v0 - v1 @@ -7490,7 +8042,6 @@ components: `false`, the upstream `Host` header will be that of the Service's `host`. type: boolean - default: false nullable: true protocols: description: >- @@ -7513,9 +8064,6 @@ components: - ws - wss type: string - default: - - http - - https nullable: true regex_priority: description: >- @@ -7526,7 +8074,6 @@ components: non-regex routes is different (longer non-regex routes are matched before shorter ones). type: integer - default: 0 nullable: true request_buffering: description: >- @@ -7534,7 +8081,6 @@ components: may make sense to turn this off on services that receive data with chunked transfer encoding. type: boolean - default: true nullable: true response_buffering: description: >- @@ -7542,7 +8088,6 @@ components: may make sense to turn this off on services that send data with chunked transfer encoding. type: boolean - default: true nullable: true snis: description: A list of SNIs that match this Route when using stream routing. @@ -7569,7 +8114,6 @@ components: When matching a Route via one of the `paths`, strip the matching prefix from the upstream request URL. type: boolean - default: true nullable: true tags: description: >- @@ -7578,7 +8122,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -7613,6 +8156,9 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + nullable: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -7630,7 +8176,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -7670,7 +8215,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -7719,12 +8263,13 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null connect_timeout: description: >- The timeout in milliseconds for establishing a connection to the upstream server. type: integer - default: 60000 nullable: true created_at: description: Unix epoch when the resource was created. @@ -7736,7 +8281,6 @@ components: will be as if any routes attached to it do not exist (404). Default: `true`. type: boolean - default: true nullable: true host: description: >- @@ -7757,11 +8301,9 @@ components: port: description: The upstream server port. type: integer - default: 80 protocol: description: The protocol used to communicate with the upstream. type: string - default: http enum: - grpc - grpcs @@ -7778,12 +8320,10 @@ components: The timeout in milliseconds between two successive read operations for transmitting a request to the upstream server. type: integer - default: 60000 nullable: true retries: description: The number of retries to execute upon failure to proxy. type: integer - default: 5 nullable: true tags: description: >- @@ -7792,7 +8332,6 @@ components: type: array items: type: string - nullable: true tls_verify: description: >- Whether to enable verification of upstream server TLS certificate. @@ -7820,7 +8359,6 @@ components: The timeout in milliseconds between two successive write operations for transmitting a request to the upstream server. type: integer - default: 60000 nullable: true example: host: example.internal @@ -7859,7 +8397,6 @@ components: type: array items: type: string - nullable: true target: description: >- The target address (ip or hostname) and port. If the hostname @@ -7879,13 +8416,14 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null weight: description: >- The weight this target gets within the upstream loadbalancer (`0`-`65535`). If the hostname resolves to an SRV record, the `weight` value will be overridden by the value from the DNS record. type: integer - default: 100 nullable: true example: id: 089292a7-ba3d-4d88-acf0-97b4b2e2621a @@ -7919,7 +8457,6 @@ components: type: array items: type: string - nullable: true target: description: >- The target address (ip or hostname) and port. If the hostname @@ -7937,7 +8474,6 @@ components: (`0`-`65535`). If the hostname resolves to an SRV record, the `weight` value will be overridden by the value from the DNS record. type: integer - default: 100 nullable: true example: id: 089292a7-ba3d-4d88-acf0-97b4b2e2621a @@ -7960,7 +8496,6 @@ components: algorithm: description: Which load balancing algorithm to use. type: string - default: round-robin enum: - consistent-hashing - least-connections @@ -7978,6 +8513,8 @@ components: id: type: string x-foreign: true + x-speakeasy-terraform-plan-only: true + default: null created_at: description: Unix epoch when the resource was created. type: integer @@ -7988,7 +8525,6 @@ components: return a hash (eg. header is missing, or no Consumer identified). Not available if `hash_on` is set to `cookie`. type: string - default: none enum: - none - consumer @@ -8022,7 +8558,6 @@ components: What to use as hashing input. Using `none` results in a weighted-round-robin scheme with no hashing. type: string - default: none enum: - none - consumer @@ -8046,7 +8581,6 @@ components: The cookie path to set in the response headers. Only required when `hash_on` or `hash_fallback` is set to `cookie`. type: string - default: / nullable: true hash_on_header: description: >- @@ -8075,7 +8609,6 @@ components: properties: concurrency: type: integer - default: 10 headers: type: object additionalProperties: @@ -8087,29 +8620,20 @@ components: type: array items: type: integer - default: - - 200 - - 302 interval: type: number - default: 0 successes: type: integer - default: 0 http_path: type: string - default: / https_sni: type: string https_verify_certificate: type: boolean - default: true timeout: type: number - default: 1 type: type: string - default: http enum: - tcp - http @@ -8121,29 +8645,16 @@ components: properties: http_failures: type: integer - default: 0 http_statuses: type: array items: type: integer - default: - - 429 - - 404 - - 500 - - 501 - - 502 - - 503 - - 504 - - 505 interval: type: number - default: 0 tcp_failures: type: integer - default: 0 timeouts: type: integer - default: 0 passive: type: object properties: @@ -8154,32 +8665,10 @@ components: type: array items: type: integer - default: - - 200 - - 201 - - 202 - - 203 - - 204 - - 205 - - 206 - - 207 - - 208 - - 226 - - 300 - - 301 - - 302 - - 303 - - 304 - - 305 - - 306 - - 307 - - 308 successes: type: integer - default: 0 type: type: string - default: http enum: - tcp - http @@ -8191,24 +8680,16 @@ components: properties: http_failures: type: integer - default: 0 http_statuses: type: array items: type: integer - default: - - 429 - - 500 - - 503 tcp_failures: type: integer - default: 0 timeouts: type: integer - default: 0 threshold: type: number - default: 0 host_header: description: >- The hostname to be used as `Host` header when proxying requests @@ -8229,7 +8710,6 @@ components: setting determines the actual number of slots in the algorithm. Accepts an integer in the range `10`-`65536`. type: integer - default: 10000 nullable: true tags: description: >- @@ -8238,7 +8718,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -8248,7 +8727,6 @@ components: If set, the balancer will use SRV hostname(if DNS Answer has SRV record) as the proxy upstream `Host`. type: boolean - default: false nullable: true example: algorithm: round-robin @@ -8368,7 +8846,6 @@ components: type: array items: type: string - nullable: true updated_at: description: Unix epoch when the resource was last updated. type: integer @@ -8388,7 +8865,7 @@ components: - name - prefix requestBodies: - GroupMemebershipAdd: + GroupMembershipAdd: content: application/json: schema: @@ -8404,7 +8881,7 @@ components: description: >- Request body for removing a list of child control planes from a control plane group membership. - GroupMemebershipUpsert: + GroupMembershipUpsert: content: application/json: schema: @@ -8783,11 +9260,6 @@ components: type: array items: type: string - default: openid - default: - - email - - openid - - profile claim_mappings: type: object minProperties: 3 @@ -8795,15 +9267,12 @@ components: name: type: string example: name - default: name email: type: string example: email - default: email groups: type: string example: custom-group-claim - default: groups description: The request schema for the update IdP configuration request. DataPlaneClientCertificateRequest: content: @@ -8984,6 +9453,9 @@ components: type: array items: $ref: '#/components/schemas/ControlPlane' + required: + - meta + - data GetGroupStatus: description: Status of a control plane group, including existing conflicts. content: @@ -10002,6 +10474,8 @@ components: enum: - active - inactive + - deleting + - deleted retention_period_days: description: >- The number of days an organization spends inactive before @@ -10028,7 +10502,7 @@ components: application/json: schema: $ref: '#/components/schemas/DataPlaneClientCertificate' - get-expected-config-hash: + GetExpectedConfigHashResponse: description: >- Response body for retrieving the expected config hash of the control plane. @@ -10046,6 +10520,10 @@ components: updated_at: description: Date the control plane configuration was last updated. type: integer + required: + - expected_hash + - created_at + - updated_at ListDataPlaneCertificatesResponse: description: Example response content: @@ -10493,6 +10971,7 @@ tags: - name: Basic-auth credentials - name: JWTs - name: HMAC-auth credentials + - name: MTLS-auth credentials - name: ACLs externalDocs: description: Documentation for Kong Gateway and its APIs diff --git a/plugins.go b/plugins.go index 42aa1a0..ed4376e 100644 --- a/plugins.go +++ b/plugins.go @@ -31,6 +31,1832 @@ func newPlugins(sdkConfig sdkConfiguration) *Plugins { } } +// ListPluginWithConsumerGroup - List all Plugins associated with a Consumer Group +// List all Plugins associated with a Consumer Group +func (s *Plugins) ListPluginWithConsumerGroup(ctx context.Context, request operations.ListPluginWithConsumerGroupRequest, opts ...operations.Option) (*operations.ListPluginWithConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-plugin-with-consumer_group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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); 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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPluginWithConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.ListPluginWithConsumerGroupResponseBody + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreatePluginWithConsumerGroup - Create a new Plugin associated with a Consumer Group +// Create a new Plugin associated with a Consumer Group +func (s *Plugins) CreatePluginWithConsumerGroup(ctx context.Context, request operations.CreatePluginWithConsumerGroupRequest, opts ...operations.Option) (*operations.CreatePluginWithConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-plugin-with-consumer_group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PluginWithoutParents", "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, "POST", 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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreatePluginWithConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + 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.Plugin + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Plugin = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeletePluginWithConsumerGroup - Delete a a Plugin associated with a Consumer Group +// Delete a a Plugin associated with a Consumer Group using ID. +func (s *Plugins) DeletePluginWithConsumerGroup(ctx context.Context, request operations.DeletePluginWithConsumerGroupRequest, opts ...operations.Option) (*operations.DeletePluginWithConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "delete-plugin-with-consumer_group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeletePluginWithConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPluginWithConsumerGroup - Fetch a Plugin associated with a Consumer Group +// Get a Plugin associated with a Consumer Group using ID. +func (s *Plugins) GetPluginWithConsumerGroup(ctx context.Context, request operations.GetPluginWithConsumerGroupRequest, opts ...operations.Option) (*operations.GetPluginWithConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-plugin-with-consumer_group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPluginWithConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.Plugin + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Plugin = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(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: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpsertPluginWithConsumerGroup - Upsert a Plugin associated with a Consumer Group +// Create or Update a Plugin associated with a Consumer Group using ID. +func (s *Plugins) UpsertPluginWithConsumerGroup(ctx context.Context, request operations.UpsertPluginWithConsumerGroupRequest, opts ...operations.Option) (*operations.UpsertPluginWithConsumerGroupResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "upsert-plugin-with-consumer_group", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PluginWithoutParents", "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, "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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpsertPluginWithConsumerGroupResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.Plugin + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Plugin = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// ListPluginWithConsumer - List all Plugins associated with a Consumer +// List all Plugins associated with a Consumer +func (s *Plugins) ListPluginWithConsumer(ctx context.Context, request operations.ListPluginWithConsumerRequest, opts ...operations.Option) (*operations.ListPluginWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "list-plugin-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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); 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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.ListPluginWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.ListPluginWithConsumerResponseBody + 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, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// CreatePluginWithConsumer - Create a new Plugin associated with a Consumer +// Create a new Plugin associated with a Consumer +func (s *Plugins) CreatePluginWithConsumer(ctx context.Context, request operations.CreatePluginWithConsumerRequest, opts ...operations.Option) (*operations.CreatePluginWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "create-plugin-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PluginWithoutParents", "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, "POST", 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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.CreatePluginWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + 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.Plugin + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Plugin = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// DeletePluginWithConsumer - Delete a a Plugin associated with a Consumer +// Delete a a Plugin associated with a Consumer using ID. +func (s *Plugins) DeletePluginWithConsumer(ctx context.Context, request operations.DeletePluginWithConsumerRequest, opts ...operations.Option) (*operations.DeletePluginWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "delete-plugin-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "DELETE", opURL, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "*/*") + req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.DeletePluginWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: httpRes, + } + + switch { + case httpRes.StatusCode == 204: + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// GetPluginWithConsumer - Fetch a Plugin associated with a Consumer +// Get a Plugin associated with a Consumer using ID. +func (s *Plugins) GetPluginWithConsumer(ctx context.Context, request operations.GetPluginWithConsumerRequest, opts ...operations.Option) (*operations.GetPluginWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "get-plugin-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", 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, "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 + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"404", "4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.GetPluginWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.Plugin + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Plugin = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(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: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + +// UpsertPluginWithConsumer - Upsert a Plugin associated with a Consumer +// Create or Update a Plugin associated with a Consumer using ID. +func (s *Plugins) UpsertPluginWithConsumer(ctx context.Context, request operations.UpsertPluginWithConsumerRequest, opts ...operations.Option) (*operations.UpsertPluginWithConsumerResponse, error) { + hookCtx := hooks.HookContext{ + Context: ctx, + OperationID: "upsert-plugin-with-consumer", + OAuth2Scopes: []string{}, + SecuritySource: s.sdkConfiguration.Security, + } + + 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) + } + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "PluginWithoutParents", "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, "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) + req.Header.Set("Content-Type", reqContentType) + + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { + return nil, err + } + + 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 { + copyBody, err := req.GetBody() + if err != nil { + return nil, err + } + req.Body = copyBody + } + + req, err = s.sdkConfiguration.Hooks.BeforeRequest(hooks.BeforeRequestContext{HookContext: hookCtx}, req) + if err != nil { + return nil, backoff.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + } + return httpRes, err + }) + + if err != nil { + return nil, err + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } else { + req, err = s.sdkConfiguration.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.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) + return nil, err + } else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) { + _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) + if err != nil { + return nil, err + } else if _httpRes != nil { + httpRes = _httpRes + } + } else { + httpRes, err = s.sdkConfiguration.Hooks.AfterSuccess(hooks.AfterSuccessContext{HookContext: hookCtx}, httpRes) + if err != nil { + return nil, err + } + } + } + + res := &operations.UpsertPluginWithConsumerResponse{ + StatusCode: httpRes.StatusCode, + ContentType: httpRes.Header.Get("Content-Type"), + RawResponse: 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.Plugin + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Plugin = &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError("unknown status code returned", httpRes.StatusCode, string(rawBody), httpRes) + } + + return res, nil + +} + // ListPlugin - List all Plugins // List all Plugins func (s *Plugins) ListPlugin(ctx context.Context, request operations.ListPluginRequest, opts ...operations.Option) (*operations.ListPluginResponse, error) { diff --git a/sdk.go b/sdk.go index c3a9cf8..bd15f02 100644 --- a/sdk.go +++ b/sdk.go @@ -94,6 +94,14 @@ type SDK struct { // Consumer groups enable the organization and categorization of consumers (users or applications) within an API ecosystem. // By grouping consumers together, you eliminate the need to manage them individually, providing a scalable, efficient approach to managing configurations. ConsumerGroups *ConsumerGroups + // A plugin entity represents a plugin configuration that will be executed during the HTTP request/response lifecycle. Plugins let you add functionality to services that run behind a Kong Gateway instance, like authentication or rate limiting. + // You can find more information about available plugins and which values each plugin accepts at the [Plugin Hub](https://docs.konghq.com/hub/). + //

+ // When adding a plugin configuration to a service, the plugin will run on every request made by a client to that service. If a plugin needs to be tuned to different values for some specific consumers, you can do so by creating a separate plugin instance that specifies both the service and the consumer, through the service and consumer fields. + //

+ // Plugins can be both [tagged and filtered by tags](https://docs.konghq.com/gateway/latest/admin-api/#tags). + // + Plugins *Plugins // The consumer object represents a consumer - or a user - of a service. // You can either rely on Kong Gateway as the primary datastore, or you can map the consumer list with your database to keep consistency between Kong Gateway and your existing primary datastore. // @@ -101,6 +109,7 @@ type SDK struct { HMACAuthCredentials *HMACAuthCredentials JWTs *JWTs APIKeys *APIKeys + MTLSAuthCredentials *MTLSAuthCredentials // A JSON Web key set. Key sets are the preferred way to expose keys to plugins because they tell the plugin where to look for keys or have a scoping mechanism to restrict plugins to specific keys. // KeySets *KeySets @@ -109,14 +118,6 @@ type SDK struct { Keys *Keys // Custom Plugin Schemas CustomPluginSchemas *CustomPluginSchemas - // A plugin entity represents a plugin configuration that will be executed during the HTTP request/response lifecycle. Plugins let you add functionality to services that run behind a Kong Gateway instance, like authentication or rate limiting. - // You can find more information about available plugins and which values each plugin accepts at the [Plugin Hub](https://docs.konghq.com/hub/). - //

- // When adding a plugin configuration to a service, the plugin will run on every request made by a client to that service. If a plugin needs to be tuned to different values for some specific consumers, you can do so by creating a separate plugin instance that specifies both the service and the consumer, through the service and consumer fields. - //

- // Plugins can be both [tagged and filtered by tags](https://docs.konghq.com/gateway/latest/admin-api/#tags). - // - Plugins *Plugins // Route entities define rules to match client requests. Each route is associated with a service, and a service may have multiple routes associated to it. Every request matching a given route will be proxied to the associated service. You need at least one matching rule that applies to the protocol being matched by the route. //

// The combination of routes and services, and the separation of concerns between them, offers a powerful routing mechanism with which it is possible to define fine-grained entrypoints in Kong Gateway leading to different upstream services of your infrastructure. @@ -260,9 +261,9 @@ func New(opts ...SDKOption) *SDK { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.1", - SDKVersion: "0.1.5", - GenVersion: "2.447.4", - UserAgent: "speakeasy-sdk/go 0.1.5 2.447.4 0.0.1 github.com/Kong/sdk-konnect-go", + SDKVersion: "0.1.6", + GenVersion: "2.457.9", + UserAgent: "speakeasy-sdk/go 0.1.6 2.457.9 0.0.1 github.com/Kong/sdk-konnect-go", Hooks: hooks.New(), }, } @@ -296,6 +297,8 @@ func New(opts ...SDKOption) *SDK { sdk.ConsumerGroups = newConsumerGroups(sdk.sdkConfiguration) + sdk.Plugins = newPlugins(sdk.sdkConfiguration) + sdk.Consumers = newConsumers(sdk.sdkConfiguration) sdk.HMACAuthCredentials = newHMACAuthCredentials(sdk.sdkConfiguration) @@ -304,14 +307,14 @@ func New(opts ...SDKOption) *SDK { sdk.APIKeys = newAPIKeys(sdk.sdkConfiguration) + sdk.MTLSAuthCredentials = newMTLSAuthCredentials(sdk.sdkConfiguration) + sdk.KeySets = newKeySets(sdk.sdkConfiguration) sdk.Keys = newKeys(sdk.sdkConfiguration) sdk.CustomPluginSchemas = newCustomPluginSchemas(sdk.sdkConfiguration) - sdk.Plugins = newPlugins(sdk.sdkConfiguration) - sdk.Routes = newRoutes(sdk.sdkConfiguration) sdk.Services = newServices(sdk.sdkConfiguration) diff --git a/teammembership.go b/teammembership.go index 3d4be51..d0b5dda 100644 --- a/teammembership.go +++ b/teammembership.go @@ -395,7 +395,7 @@ func (s *TeamMembership) AddUserToTeam(ctx context.Context, teamID string, addUs _, err = s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err) return nil, err - } else if utils.MatchStatusCodes([]string{"400", "404", "4XX", "5XX"}, httpRes.StatusCode) { + } else if utils.MatchStatusCodes([]string{"400", "404", "409", "4XX", "5XX"}, httpRes.StatusCode) { _httpRes, err := s.sdkConfiguration.Hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil) if err != nil { return nil, err @@ -452,6 +452,27 @@ func (s *TeamMembership) AddUserToTeam(ctx context.Context, teamID string, addUs return nil, err } + return nil, &out + default: + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 409: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/problem+json`): + rawBody, err := utils.ConsumeRawBody(httpRes) + if err != nil { + return nil, err + } + + var out sdkerrors.ConflictError + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + return nil, &out default: rawBody, err := utils.ConsumeRawBody(httpRes)