From d718c17dfa92ab0342d4bf1faf19f5a803aac38c Mon Sep 17 00:00:00 2001 From: Andrew Reed <w.andrew.reed@gmail.com> Date: Thu, 13 Jul 2023 15:51:24 -0500 Subject: [PATCH] Add collections and instances (#5) --- .github/workflows/cron-test.yaml | 2 + .github/workflows/test.yml | 4 +- CHANGELOG.md | 2 + docs/data-sources/collection.md | 36 + docs/data-sources/collection_instance.md | 36 + docs/resources/collection.md | 45 + docs/resources/collection_instance.md | 45 + e2e/authority.tf | 51 + e2e/ca.crt | 10 + e2e/managed.tf | 12 + e2e/provider.tf | 66 - e2e/provisioner.tf | 35 +- .../smallstep_collection/data-source.tf | 4 + .../data-source.tf | 5 + .../resources/smallstep_collection/import.sh | 1 + .../smallstep_collection/resource.tf | 4 + .../smallstep_collection_instance/import.sh | 1 + .../smallstep_collection_instance/resource.tf | 8 + internal/apiclient/v20230301/api.gen.go | 6518 ++++++++++++----- internal/apiserver/v20230301/api.gen.go | 3057 ++++++-- internal/provider/collection/data_source.go | 139 + internal/provider/collection/model.go | 45 + internal/provider/collection/resource.go | 244 + .../provider/collection_data_source_test.go | 36 + .../collection_instance/data_source.go | 138 + .../provider/collection_instance/model.go | 62 + .../provider/collection_instance/resource.go | 266 + internal/provider/collection_resource_test.go | 111 + .../provider/instance_data_source_test.go | 43 + internal/provider/instance_resource_test.go | 73 + internal/provider/provider.go | 6 + internal/provider/provisioner/model.go | 3 +- internal/provider/provisioner/resource.go | 25 +- internal/provider/utils/equal.go | 69 + internal/provider/utils/optional.go | 53 +- internal/provider/utils/testutils.go | 319 + internal/provider/utils/utils.go | 20 +- 37 files changed, 8852 insertions(+), 2742 deletions(-) create mode 100644 docs/data-sources/collection.md create mode 100644 docs/data-sources/collection_instance.md create mode 100644 docs/resources/collection.md create mode 100644 docs/resources/collection_instance.md create mode 100644 e2e/authority.tf create mode 100644 e2e/ca.crt create mode 100644 e2e/managed.tf create mode 100644 examples/data-sources/smallstep_collection/data-source.tf create mode 100644 examples/data-sources/smallstep_collection_instance/data-source.tf create mode 100644 examples/resources/smallstep_collection/import.sh create mode 100644 examples/resources/smallstep_collection/resource.tf create mode 100644 examples/resources/smallstep_collection_instance/import.sh create mode 100644 examples/resources/smallstep_collection_instance/resource.tf create mode 100644 internal/provider/collection/data_source.go create mode 100644 internal/provider/collection/model.go create mode 100644 internal/provider/collection/resource.go create mode 100644 internal/provider/collection_data_source_test.go create mode 100644 internal/provider/collection_instance/data_source.go create mode 100644 internal/provider/collection_instance/model.go create mode 100644 internal/provider/collection_instance/resource.go create mode 100644 internal/provider/collection_resource_test.go create mode 100644 internal/provider/instance_data_source_test.go create mode 100644 internal/provider/instance_resource_test.go create mode 100644 internal/provider/utils/equal.go diff --git a/.github/workflows/cron-test.yaml b/.github/workflows/cron-test.yaml index bbeea46..2fe256b 100644 --- a/.github/workflows/cron-test.yaml +++ b/.github/workflows/cron-test.yaml @@ -7,6 +7,8 @@ on: permissions: contents: read +concurrency: terraform-provider-smallstep + jobs: # Run acceptance tests in a matrix with Terraform CLI versions test: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d62ff91..a3e236a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,8 @@ on: permissions: contents: read +concurrency: terraform-provider-smallstep + jobs: # Ensure project builds before running testing matrix build: @@ -77,7 +79,7 @@ jobs: timeout-minutes: 10 sweep: runs-on: ubuntu-latest - needs: build + needs: test steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 710e90f..dfc79fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ FEATURES: * Add smallstep_provisioner resource and data source +* Add smallstep_collection resource and data source +* Add smallstep_collection_instance resource and data source BUG FIXES: diff --git a/docs/data-sources/collection.md b/docs/data-sources/collection.md new file mode 100644 index 0000000..5670be2 --- /dev/null +++ b/docs/data-sources/collection.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "smallstep_collection Data Source - terraform-provider-smallstep" +subcategory: "" +description: |- + A collection of instances +--- + +# smallstep_collection (Data Source) + +A collection of instances + +## Example Usage + +```terraform +data "smallstep_collection" "tpms" { + slug = "tpms" +} +``` + +<!-- schema generated by tfplugindocs --> +## Schema + +### Required + +- `slug` (String) A lowercase name identifying the collection. + +### Read-Only + +- `created_at` (String) +- `display_name` (String) +- `id` (String) Internal use only +- `instance_count` (Number) The number of instances in the collection +- `updated_at` (String) + + diff --git a/docs/data-sources/collection_instance.md b/docs/data-sources/collection_instance.md new file mode 100644 index 0000000..99d2356 --- /dev/null +++ b/docs/data-sources/collection_instance.md @@ -0,0 +1,36 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "smallstep_collection_instance Data Source - terraform-provider-smallstep" +subcategory: "" +description: |- + An instance in a collection +--- + +# smallstep_collection_instance (Data Source) + +An instance in a collection + +## Example Usage + +```terraform +data "smallstep_collection_instance" "tpm1" { + collection_slug = "tpms" + id = "urn:ek:sha256:RAzbOveN1Y45fYubuTxu5jOXWtOK1HbfZ7yHjBuWlyE=" +} +``` + +<!-- schema generated by tfplugindocs --> +## Schema + +### Required + +- `collection_slug` (String) The slug of the collection this instance belongs to + +### Read-Only + +- `created_at` (String) Timestamp of when the instance was added to the collection +- `data` (String) The instance data +- `id` (String) The ID of this resource. +- `updated_at` (String) Timestamp of when the instance was last changed + + diff --git a/docs/resources/collection.md b/docs/resources/collection.md new file mode 100644 index 0000000..824df5c --- /dev/null +++ b/docs/resources/collection.md @@ -0,0 +1,45 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "smallstep_collection Resource - terraform-provider-smallstep" +subcategory: "" +description: |- + A collection of instances +--- + +# smallstep_collection (Resource) + +A collection of instances + +## Example Usage + +```terraform +resource "smallstep_collection" "tpms" { + slug = "tpms" +} +``` + +<!-- schema generated by tfplugindocs --> +## Schema + +### Required + +- `slug` (String) A lowercase name identifying the collection. + +### Optional + +- `display_name` (String) + +### Read-Only + +- `created_at` (String) +- `id` (String) Internal use only +- `instance_count` (Number) The number of instances in the collection +- `updated_at` (String) + +## Import + +Import is supported using the following syntax: + +```shell +terraform import smallstep_collection.devices devices +``` diff --git a/docs/resources/collection_instance.md b/docs/resources/collection_instance.md new file mode 100644 index 0000000..8ca7ae4 --- /dev/null +++ b/docs/resources/collection_instance.md @@ -0,0 +1,45 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "smallstep_collection_instance Resource - terraform-provider-smallstep" +subcategory: "" +description: |- + An instance in a collection +--- + +# smallstep_collection_instance (Resource) + +An instance in a collection + +## Example Usage + +```terraform +resource "smallstep_collection_instance" "server1" { + id = "urn:ek:sha256:RAzbOveN1Y45fYubuTxu5jOXWtOK1HbfZ7yHjBuWlyE=" + data = "{}" + collection_slug = smallstep_collection.tpms.slug + depends_on = [smallstep_collection.tpms] +} +``` + +<!-- schema generated by tfplugindocs --> +## Schema + +### Required + +- `collection_slug` (String) The collection will be created implicitly if it does not exist. +If creating this collection with a smallstep_collection resource in the same config you MUST use depends_on to avoid race conditions. +- `data` (String) The instance data + +### Read-Only + +- `created_at` (String) Timestamp of when the instance was added to the collection +- `id` (String) The ID of this resource. +- `updated_at` (String) Timestamp of when the instance was last changed + +## Import + +Import is supported using the following syntax: + +```shell +terraform import smallstep_collection_instance.device1 devicescollection/device1 +``` diff --git a/e2e/authority.tf b/e2e/authority.tf new file mode 100644 index 0000000..8117a4a --- /dev/null +++ b/e2e/authority.tf @@ -0,0 +1,51 @@ + +resource "smallstep_authority" "advanced" { + subdomain = "myadvanced" + name = "My Advanced Authority" + type = "advanced" + admin_emails = ["eng@smallstep.com"] + active_revocation = true + intermediate_issuer = { + name = "My Custom Intermediate" + key_version = "RSA_SIGN_PKCS1_2048_SHA256" + duration = "100h" + max_path_length = 0 + name_constraints = { + critical = true + permitted_ip_ranges = ["10.32.0.0/12"] + permitted_dns_domains = [".cluster.local"] + permitted_email_addresses = ["eng@smallstep.com"] + permitted_uri_domains = ["uri.cluster.local"] + } + subject = { + common_name = "Issuer" + country = "US" + email_address = "test@smallstep.com" + locality = "San Francisco" + organization = "Engineering" + organizational_unit = "Core" + postal_code = "94108" + province = "CA" + serial_number = "1" + street_address = "26 O'Farrell St" + } + } + root_issuer = { + name = "My Custom Root" + key_version = "RSA_SIGN_PKCS1_2048_SHA256" + duration = "1000h" + max_path_length = "1" + name_constraints = { + critical = false + excluded_ip_ranges = ["10.96.0.0/12"] + excluded_dns_domains = ["example.com"] + excluded_email_addresses = ["eng@example.com"] + excluded_uri_domains = ["uri:example.com"] + } + } +} + +output "bootstrap_basic" { + value = "step ca bootstrap --ca-url https://${smallstep_authority.advanced.domain} --fingerprint ${smallstep_authority.advanced.fingerprint} --context basic" +} + diff --git a/e2e/ca.crt b/e2e/ca.crt new file mode 100644 index 0000000..9e2d317 --- /dev/null +++ b/e2e/ca.crt @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBazCCARGgAwIBAgIQIbPd9RVuu0l/eTKVVjDL9zAKBggqhkjOPQQDAjAUMRIw +EAYDVQQDEwlyb290LWNhLTEwHhcNMjIxMjE0MjIzMzE0WhcNMzIxMjExMjIzMzE0 +WjAUMRIwEAYDVQQDEwlyb290LWNhLTEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC +AASIOTDFWdDWOIyzASpf9EKEokDkc1ckVt50pjgkalI9wQ8WyH88xutdUNDjIVDK +VryJaH2DMUdWwFh07kmEyu8co0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/ +BAgwBgEB/wIBATAdBgNVHQ4EFgQUq5LjtW5K1PrPYV8mJjcCTvuKvyYwCgYIKoZI +zj0EAwIDSAAwRQIhAJRTP0IUbOVmW2ufj8VINXnBhYCCauSa1/fHNNM/5o1JAiAx ++Pkrk5eAijv8H5xDEW2ik3bUDnai7rQLzdbrEb5RPw== +-----END CERTIFICATE----- diff --git a/e2e/managed.tf b/e2e/managed.tf new file mode 100644 index 0000000..8575e7d --- /dev/null +++ b/e2e/managed.tf @@ -0,0 +1,12 @@ + +resource "smallstep_collection" "tpms" { + slug = "tpms" +} + +resource "smallstep_collection_instance" "server1" { + id = "urn:ek:sha256:RAzbOveN1Y45fYubuTxu5jOXWtOK1HbfZ7yHjBuWlyE=" + data = "{}" + collection_slug = smallstep_collection.tpms.slug + depends_on = [smallstep_collection.tpms] +} + diff --git a/e2e/provider.tf b/e2e/provider.tf index dfd06d8..84d990e 100644 --- a/e2e/provider.tf +++ b/e2e/provider.tf @@ -15,69 +15,3 @@ provider "smallstep" { # team_id = "94a7dd82-1360-4493-b1bf-b14a97c45786" # } } - -# data "smallstep_authority" "preexisting" { -# id = "129dd44e-0381-4d45-a446-216b9a6e3bf4" -# } - -resource "smallstep_authority" "basic" { - type = "devops" - active_revocation = false - admin_emails = ["eng@smallstep.com"] - name = "Basic" - subdomain = "basic" -} - -output "bootstrap_basic" { - value = "step ca bootstrap --ca-url https://${smallstep_authority.basic.domain} --fingerprint ${smallstep_authority.basic.fingerprint} --context basic" -} - -# output "bootstrap_preexisting" { -# value = "step ca bootstrap --ca-url https://${data.smallstep_authority.preexisting.domain} --fingerprint ${data.smallstep_authority.preexisting.fingerprint} --context preexisting" -# } - -resource "smallstep_authority" "advanced" { - subdomain = "myadvanced" - name = "My Advanced Authority" - type = "advanced" - admin_emails = ["eng@smallstep.com"] - active_revocation = true - intermediate_issuer = { - name = "My Custom Intermediate" - key_version = "RSA_SIGN_PKCS1_2048_SHA256" - duration = "100h" - max_path_length = 0 - name_constraints = { - critical = true - permitted_ip_ranges = ["10.32.0.0/12"] - permitted_dns_domains = [".cluster.local"] - permitted_email_addresses = ["eng@smallstep.com"] - permitted_uri_domains = ["uri.cluster.local"] - } - subject = { - common_name = "Issuer" - country = "US" - email_address = "test@smallstep.com" - locality = "San Francisco" - organization = "Engineering" - organizational_unit = "Core" - postal_code = "94108" - province = "CA" - serial_number = "1" - street_address = "26 O'Farrell St" - } - } - root_issuer = { - name = "My Custom Root" - key_version = "RSA_SIGN_PKCS1_2048_SHA256" - duration = "1000h" - max_path_length = "1" - name_constraints = { - critical = false - excluded_ip_ranges = ["10.96.0.0/12"] - excluded_dns_domains = ["example.com"] - excluded_email_addresses = ["eng@example.com"] - excluded_uri_domains = ["uri:example.com"] - } - } -} diff --git a/e2e/provisioner.tf b/e2e/provisioner.tf index 5394781..6f6f9e3 100644 --- a/e2e/provisioner.tf +++ b/e2e/provisioner.tf @@ -1,14 +1,6 @@ -data "smallstep_provisioner" "prov" { - authority_id = "129dd44e-0381-4d45-a446-216b9a6e3bf4" - id = "af7f3b22-057c-4bd8-8832-bca9f0c59aa8" -} - -output "provisioner_name" { - value = data.smallstep_provisioner.prov.name -} resource "smallstep_provisioner" "my_oidc" { - authority_id = smallstep_authority.basic.id + authority_id = smallstep_authority.advanced.id name = "My OIDC example.com" type = "OIDC" @@ -20,7 +12,7 @@ resource "smallstep_provisioner" "my_oidc" { } resource "smallstep_provisioner" "jwk1" { - authority_id = smallstep_authority.basic.id + authority_id = smallstep_authority.advanced.id name = "jwk1" type = "JWK" @@ -30,35 +22,16 @@ resource "smallstep_provisioner" "jwk1" { } } -resource "smallstep_provisioner" "my_x5c" { - authority_id = smallstep_authority.basic.id - name = "x5c foo" - type = "X5C" - x5c = { - roots = ["-----BEGIN CERTIFICATE-----\nMIIBazCCARGgAwIBAgIQIbPd9RVuu0l/eTKVVjDL9zAKBggqhkjOPQQDAjAUMRIw\nEAYDVQQDEwlyb290LWNhLTEwHhcNMjIxMjE0MjIzMzE0WhcNMzIxMjExMjIzMzE0\nWjAUMRIwEAYDVQQDEwlyb290LWNhLTEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC\nAASIOTDFWdDWOIyzASpf9EKEokDkc1ckVt50pjgkalI9wQ8WyH88xutdUNDjIVDK\nVryJaH2DMUdWwFh07kmEyu8co0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/\nBAgwBgEB/wIBATAdBgNVHQ4EFgQUq5LjtW5K1PrPYV8mJjcCTvuKvyYwCgYIKoZI\nzj0EAwIDSAAwRQIhAJRTP0IUbOVmW2ufj8VINXnBhYCCauSa1/fHNNM/5o1JAiAx\n+Pkrk5eAijv8H5xDEW2ik3bUDnai7rQLzdbrEb5RPw==\n-----END CERTIFICATE-----"] - } -} - resource "smallstep_provisioner" "my_attest" { - authority_id = smallstep_authority.basic.id + authority_id = smallstep_authority.advanced.id name = "attest foo" type = "ACME_ATTESTATION" acme_attestation = { attestation_formats = ["apple", "step"] } } - -resource "smallstep_provisioner" "tpm_attest" { - authority_id = smallstep_authority.basic.id - name = "attest tpm" - type = "ACME_ATTESTATION" - acme_attestation = { - attestation_formats = ["tpm"] - attestation_roots = ["-----BEGIN CERTIFICATE-----\nMIIBazCCARGgAwIBAgIQIbPd9RVuu0l/eTKVVjDL9zAKBggqhkjOPQQDAjAUMRIw\nEAYDVQQDEwlyb290LWNhLTEwHhcNMjIxMjE0MjIzMzE0WhcNMzIxMjExMjIzMzE0\nWjAUMRIwEAYDVQQDEwlyb290LWNhLTEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC\nAASIOTDFWdDWOIyzASpf9EKEokDkc1ckVt50pjgkalI9wQ8WyH88xutdUNDjIVDK\nVryJaH2DMUdWwFh07kmEyu8co0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/\nBAgwBgEB/wIBATAdBgNVHQ4EFgQUq5LjtW5K1PrPYV8mJjcCTvuKvyYwCgYIKoZI\nzj0EAwIDSAAwRQIhAJRTP0IUbOVmW2ufj8VINXnBhYCCauSa1/fHNNM/5o1JAiAx\n+Pkrk5eAijv8H5xDEW2ik3bUDnai7rQLzdbrEb5RPw==\n-----END CERTIFICATE-----"] - } -} resource "smallstep_provisioner" "my_acme" { - authority_id = smallstep_authority.basic.id + authority_id = smallstep_authority.advanced.id name = "acme1" type = "ACME" acme = { diff --git a/examples/data-sources/smallstep_collection/data-source.tf b/examples/data-sources/smallstep_collection/data-source.tf new file mode 100644 index 0000000..3844a75 --- /dev/null +++ b/examples/data-sources/smallstep_collection/data-source.tf @@ -0,0 +1,4 @@ + +data "smallstep_collection" "tpms" { + slug = "tpms" +} diff --git a/examples/data-sources/smallstep_collection_instance/data-source.tf b/examples/data-sources/smallstep_collection_instance/data-source.tf new file mode 100644 index 0000000..9e3815b --- /dev/null +++ b/examples/data-sources/smallstep_collection_instance/data-source.tf @@ -0,0 +1,5 @@ + +data "smallstep_collection_instance" "tpm1" { + collection_slug = "tpms" + id = "urn:ek:sha256:RAzbOveN1Y45fYubuTxu5jOXWtOK1HbfZ7yHjBuWlyE=" +} diff --git a/examples/resources/smallstep_collection/import.sh b/examples/resources/smallstep_collection/import.sh new file mode 100644 index 0000000..5f608ad --- /dev/null +++ b/examples/resources/smallstep_collection/import.sh @@ -0,0 +1 @@ +terraform import smallstep_collection.devices devices diff --git a/examples/resources/smallstep_collection/resource.tf b/examples/resources/smallstep_collection/resource.tf new file mode 100644 index 0000000..7b2b0b4 --- /dev/null +++ b/examples/resources/smallstep_collection/resource.tf @@ -0,0 +1,4 @@ + +resource "smallstep_collection" "tpms" { + slug = "tpms" +} diff --git a/examples/resources/smallstep_collection_instance/import.sh b/examples/resources/smallstep_collection_instance/import.sh new file mode 100644 index 0000000..e04ad8a --- /dev/null +++ b/examples/resources/smallstep_collection_instance/import.sh @@ -0,0 +1 @@ +terraform import smallstep_collection_instance.device1 devicescollection/device1 diff --git a/examples/resources/smallstep_collection_instance/resource.tf b/examples/resources/smallstep_collection_instance/resource.tf new file mode 100644 index 0000000..36bd37d --- /dev/null +++ b/examples/resources/smallstep_collection_instance/resource.tf @@ -0,0 +1,8 @@ + +resource "smallstep_collection_instance" "server1" { + id = "urn:ek:sha256:RAzbOveN1Y45fYubuTxu5jOXWtOK1HbfZ7yHjBuWlyE=" + data = "{}" + collection_slug = smallstep_collection.tpms.slug + depends_on = [smallstep_collection.tpms] +} + diff --git a/internal/apiclient/v20230301/api.gen.go b/internal/apiclient/v20230301/api.gen.go index 4a916fb..a7fa818 100644 --- a/internal/apiclient/v20230301/api.gen.go +++ b/internal/apiclient/v20230301/api.gen.go @@ -43,6 +43,47 @@ const ( AuthorityTypeDevops AuthorityType = "devops" ) +// Defines values for EndpointCertificateInfoType. +const ( + EndpointCertificateInfoTypeSSHHOST EndpointCertificateInfoType = "SSH_HOST" + EndpointCertificateInfoTypeSSHUSER EndpointCertificateInfoType = "SSH_USER" + EndpointCertificateInfoTypeX509 EndpointCertificateInfoType = "X509" +) + +// Defines values for EndpointConfigurationKind. +const ( + DEVICE EndpointConfigurationKind = "DEVICE" + PEOPLE EndpointConfigurationKind = "PEOPLE" + WORKLOAD EndpointConfigurationKind = "WORKLOAD" +) + +// Defines values for EndpointKeyInfoFormat. +const ( + EndpointKeyInfoFormatDEFAULT EndpointKeyInfoFormat = "DEFAULT" + EndpointKeyInfoFormatDER EndpointKeyInfoFormat = "DER" + EndpointKeyInfoFormatOPENSSH EndpointKeyInfoFormat = "OPENSSH" + EndpointKeyInfoFormatPKCS8 EndpointKeyInfoFormat = "PKCS8" +) + +// Defines values for EndpointKeyInfoType. +const ( + EndpointKeyInfoTypeDEFAULT EndpointKeyInfoType = "DEFAULT" + EndpointKeyInfoTypeECDSAP256 EndpointKeyInfoType = "ECDSA_P256" + EndpointKeyInfoTypeECDSAP384 EndpointKeyInfoType = "ECDSA_P384" + EndpointKeyInfoTypeECDSAP521 EndpointKeyInfoType = "ECDSA_P521" + EndpointKeyInfoTypeED25519 EndpointKeyInfoType = "ED25519" + EndpointKeyInfoTypeRSA2048 EndpointKeyInfoType = "RSA_2048" + EndpointKeyInfoTypeRSA3072 EndpointKeyInfoType = "RSA_3072" + EndpointKeyInfoTypeRSA4096 EndpointKeyInfoType = "RSA_4096" +) + +// Defines values for EndpointReloadInfoMethod. +const ( + AUTOMATIC EndpointReloadInfoMethod = "AUTOMATIC" + CUSTOM EndpointReloadInfoMethod = "CUSTOM" + SIGNAL EndpointReloadInfoMethod = "SIGNAL" +) + // Defines values for NewAuthorityType. const ( NewAuthorityTypeAdvanced NewAuthorityType = "advanced" @@ -58,11 +99,22 @@ const ( X5C ProvisionerType = "X5C" ) -// Defines values for WebhookCertType. +// Defines values for ProvisionerWebhookCertType. +const ( + ProvisionerWebhookCertTypeALL ProvisionerWebhookCertType = "ALL" + ProvisionerWebhookCertTypeSSH ProvisionerWebhookCertType = "SSH" + ProvisionerWebhookCertTypeX509 ProvisionerWebhookCertType = "X509" +) + +// Defines values for ProvisionerWebhookKind. +const ( + ENRICHING ProvisionerWebhookKind = "ENRICHING" +) + +// Defines values for ProvisionerWebhookServerType. const ( - ALL WebhookCertType = "ALL" - SSH WebhookCertType = "SSH" - X509 WebhookCertType = "X509" + EXTERNAL ProvisionerWebhookServerType = "EXTERNAL" + HOSTEDATTESTATION ProvisionerWebhookServerType = "HOSTED_ATTESTATION" ) // Defines values for X509IssuerKeyVersion. @@ -117,6 +169,24 @@ type AcmeProvisioner struct { // AcmeProvisionerChallenges defines model for AcmeProvisioner.Challenges. type AcmeProvisionerChallenges string +// AgentConfiguration The agent configuration describes the attestation authority used by the agent to grant workload certificates. +type AgentConfiguration struct { + // AttestationSlug The slug of the attestation authority the agent connects to to get a certificate. + AttestationSlug *string `json:"attestationSlug,omitempty"` + + // AuthorityID UUID identifying the authority the agent uses to generate endpoint certificates. + AuthorityID string `json:"authorityID"` + + // Id A UUID identifying this agent configuration. Generated server-side on creation. + Id *string `json:"id,omitempty"` + + // Name The name of this agent configuration. + Name string `json:"name"` + + // Provisioner The name of the provisioner on the authority the agent uses to generate endpoint certificates. + Provisioner string `json:"provisioner"` +} + // AttestationAuthority An attestation authority used with the device-attest-01 ACME challenge to verify a device's hardware identity. This object is experimental and subject to change. type AttestationAuthority struct { // AttestorIntermediates The pem-encoded list of intermediate certificates used to build a chain of trust to verify the attestation certificates submitted by devices. @@ -125,7 +195,7 @@ type AttestationAuthority struct { // AttestorRoots The pem-encoded list of certificates used to verify the attestation certificates submitted by devices. AttestorRoots string `json:"attestorRoots"` - // Catalog The slug of an inventory that holds the list of devices belonging to the team + // Catalog The slug of a collection that holds the list of devices belonging to the team Catalog string `json:"catalog"` // CreatedAt Timestamp in RFC3339 format when the attestation authority was created @@ -186,6 +256,40 @@ type AuthorityCsr struct { // AuthorityType One of the available authority types type AuthorityType string +// BasicAuth Configures provisioner webhook requests to include an Authorization header with these credentials. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. At most one of `bearerToken` and `basicAuth` may be set. +type BasicAuth struct { + Password string `json:"password"` + Username string `json:"username"` +} + +// Collection A collection of instances +type Collection struct { + CreatedAt time.Time `json:"createdAt"` + + // DisplayName A user-friendly name for the collection + DisplayName string `json:"displayName"` + + // InstanceCount The number of instances in the collection + InstanceCount int `json:"instanceCount"` + + // Slug A lowercase name identifying the collection. + Slug string `json:"slug"` + UpdatedAt time.Time `json:"updatedAt"` +} + +// CollectionInstance An instance in a collection +type CollectionInstance struct { + // CreatedAt Timestamp of when the instance was added to the collection + CreatedAt time.Time `json:"createdAt"` + + // Data The instance data + Data interface{} `json:"data"` + Id string `json:"id"` + + // UpdatedAt Timestamp of when the instance was last changed + UpdatedAt time.Time `json:"updatedAt"` +} + // DistinguishedName Name used in x509 certificates type DistinguishedName struct { CommonName *string `json:"commonName,omitempty"` @@ -206,6 +310,144 @@ type Email struct { Primary *bool `json:"primary,omitempty"` } +// EndpointCertificateInfo Details on a managed certificate +type EndpointCertificateInfo struct { + // CrtFile The filepath where the certificate is to be stored. + CrtFile *string `json:"crtFile,omitempty"` + + // Duration The certificate lifetime. Parsed as a [Golang duration](https://pkg.go.dev/time#ParseDuration). + Duration *string `json:"duration,omitempty"` + + // Gid GID of the files where the certificate is stored. + Gid *int `json:"gid,omitempty"` + + // KeyFile The filepath where the key is to be stored. + KeyFile *string `json:"keyFile,omitempty"` + + // Mode Permission bits of the files where the certificate is stored. + Mode *int `json:"mode,omitempty"` + + // RootFile The filepath where the root certificate is to be stored. + RootFile *string `json:"rootFile,omitempty"` + + // Type The type of certificate + Type EndpointCertificateInfoType `json:"type"` + + // Uid UID of the files where the certificate is stored. + Uid *int `json:"uid,omitempty"` +} + +// EndpointCertificateInfoType The type of certificate +type EndpointCertificateInfoType string + +// EndpointConfiguration Configuration for a managed endpoint +type EndpointConfiguration struct { + // AuthorityID UUID identifying the authority that will issue certificates for the endpoint. + AuthorityID string `json:"authorityID"` + + // CertificateInfo Details on a managed certificate + CertificateInfo EndpointCertificateInfo `json:"certificateInfo"` + + // Hooks The collection of commands to run when a certificate for a managed endpoint is signed or renewed. + Hooks *EndpointHooks `json:"hooks,omitempty"` + + // Id A UUID identifying this endpoint configuration. Generated server-side when the endpoint configuration is created. + Id *string `json:"id,omitempty"` + + // KeyInfo The attributes of the cryptographic key. + KeyInfo *EndpointKeyInfo `json:"keyInfo,omitempty"` + + // Kind The kind of endpoint this configuration applies to. + Kind EndpointConfigurationKind `json:"kind"` + + // Name The name of the endpoint configuration. + Name string `json:"name"` + + // Provisioner Name of the provisioner on the authority that will authorize certificates for the endpoint. + Provisioner string `json:"provisioner"` + + // ReloadInfo The properties used to reload a service. + ReloadInfo *EndpointReloadInfo `json:"reloadInfo,omitempty"` +} + +// EndpointConfigurationKind The kind of endpoint this configuration applies to. +type EndpointConfigurationKind string + +// EndpointHook A list of commands to run before and after a certificate is granted. +type EndpointHook struct { + // After List of commands to run after the operation. + After *[]string `json:"after,omitempty"` + + // Before List of commands to run before the operation. + Before *[]string `json:"before,omitempty"` + + // OnError List of commands to run when the operation fails. + OnError *[]string `json:"onError,omitempty"` + + // Shell The shell to use to execute the commands. + Shell *string `json:"shell,omitempty"` +} + +// EndpointHooks The collection of commands to run when a certificate for a managed endpoint is signed or renewed. +type EndpointHooks struct { + // Renew A list of commands to run before and after a certificate is granted. + Renew *EndpointHook `json:"renew,omitempty"` + + // Sign A list of commands to run before and after a certificate is granted. + Sign *EndpointHook `json:"sign,omitempty"` +} + +// EndpointKeyInfo The attributes of the cryptographic key. +type EndpointKeyInfo struct { + // Format The format used to encode the private key. For X509 keys the default format is SEC 1 for ECDSA keys, PKCS#1 for RSA keys and PKCS#8 for ED25519 keys. For SSH keys the default format is always the OPENSSH format. + Format *EndpointKeyInfoFormat `json:"format,omitempty"` + + // PubFile A CSR or SSH public key to use instead of generating one. + PubFile *string `json:"pubFile,omitempty"` + + // Type The key type used. The current DEFAULT type is ECDSA_P256. + Type *EndpointKeyInfoType `json:"type,omitempty"` +} + +// EndpointKeyInfoFormat The format used to encode the private key. For X509 keys the default format is SEC 1 for ECDSA keys, PKCS#1 for RSA keys and PKCS#8 for ED25519 keys. For SSH keys the default format is always the OPENSSH format. +type EndpointKeyInfoFormat string + +// EndpointKeyInfoType The key type used. The current DEFAULT type is ECDSA_P256. +type EndpointKeyInfoType string + +// EndpointReloadInfo The properties used to reload a service. +type EndpointReloadInfo struct { + // Method Ways an endpoint can reload a certificate. `AUTOMATIC` means the process is able to detect and reload new certificates automatically. `CUSTOM` means a custom command must be run to trigger the workload to reload the certificates. `SIGNAL` will configure the agent to send a signal to the process in pidFile. + Method EndpointReloadInfoMethod `json:"method"` + + // PidFile File that holds the pid of the process to signal. Required when method is SIGNAL. + PidFile *string `json:"pidFile,omitempty"` + + // Signal The signal to send to a process when a certificate should be reloaded. Required when method is SIGNAL. + Signal *int `json:"signal,omitempty"` +} + +// EndpointReloadInfoMethod Ways an endpoint can reload a certificate. `AUTOMATIC` means the process is able to detect and reload new certificates automatically. `CUSTOM` means a custom command must be run to trigger the workload to reload the certificates. `SIGNAL` will configure the agent to send a signal to the process in pidFile. +type EndpointReloadInfoMethod string + +// EndpointSSHCertificateData Contains the information to include when granting an SSH certificate to an endpoint. +type EndpointSSHCertificateData struct { + // KeyID The key ID to include in the endpoint certificate. + KeyID string `json:"keyID"` + + // Principals The principals to include in the endpoint certificate. + Principals []string `json:"principals"` +} + +// EndpointX509CertificateData Contains the information to include when granting an x509 certificate to an endpoint. +type EndpointX509CertificateData struct { + // CommonName The Common Name to be used in the subject of the endpoint certificate. + CommonName string `json:"commonName"` + + // Sans The list of SANs to include in the endpoint certificate. + Sans []string `json:"sans"` +} + // Error defines model for error. type Error struct { // Message A description of the error @@ -270,41 +512,44 @@ type Host struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } -// Inventory A collection of items -type Inventory struct { - CreatedAt time.Time `json:"createdAt"` - - // DisplayName A user-friendly name for the inventory - DisplayName string `json:"displayName"` - - // ItemCount The number of items in the inventory - ItemCount int `json:"itemCount"` +// JwkProvisioner defines model for jwkProvisioner. +type JwkProvisioner struct { + // EncryptedKey The JWE encrypted private key + EncryptedKey *string `json:"encryptedKey,omitempty"` - // Slug A lowercase name identifying the inventory. - Slug string `json:"slug"` - UpdatedAt time.Time `json:"updatedAt"` + // Key The public JSON web key + Key interface{} `json:"key"` } -// InventoryItem An item in an inventory -type InventoryItem struct { - // CreatedAt Timestamp of when the item was added to the inventory - CreatedAt time.Time `json:"createdAt"` +// ManagedConfiguration The agent and managed endpoints used in one host. +type ManagedConfiguration struct { + // AgentConfigurationID UUID identifying the agent configuration. + AgentConfigurationID string `json:"agentConfigurationID"` - // Data The item data - Data interface{} `json:"data"` - Id string `json:"id"` + // HostID UUID identifying the host this managed configuration is for. Will be generated on server-side if not provided. + HostID *string `json:"hostID,omitempty"` - // UpdatedAt Timestamp of when the item was last changed - UpdatedAt time.Time `json:"updatedAt"` + // Id UUID identifying this managed configuration. + Id *string `json:"id,omitempty"` + ManagedEndpoints []ManagedEndpoint `json:"managedEndpoints"` + + // Name The name of this managed configuration. + Name string `json:"name"` } -// JwkProvisioner defines model for jwkProvisioner. -type JwkProvisioner struct { - // EncryptedKey The JWE encrypted private key - EncryptedKey *string `json:"encryptedKey,omitempty"` +// ManagedEndpoint All the information used by an agent to grant a certificate to an endpoint. Exactly one of `x509CertificateData` or `sshCertificateData` must be set and must match the endpoint configuration certificate info type. +type ManagedEndpoint struct { + // EndpointConfigurationID UUID identifying the endpoint configuration. + EndpointConfigurationID string `json:"endpointConfigurationID"` - // Key The public JSON web key - Key interface{} `json:"key"` + // Id UUID identifying this managed endpoint. Generated server-side on creation. + Id *string `json:"id,omitempty"` + + // SshCertificateData Contains the information to include when granting an SSH certificate to an endpoint. + SshCertificateData *EndpointSSHCertificateData `json:"sshCertificateData,omitempty"` + + // X509CertificateData Contains the information to include when granting an x509 certificate to an endpoint. + X509CertificateData *EndpointX509CertificateData `json:"x509CertificateData,omitempty"` } // NameConstraints defines model for name-constraints. @@ -363,6 +608,15 @@ type NewAuthorityCsr struct { Subdomain string `json:"subdomain"` } +// NewCollection A collection of instances +type NewCollection struct { + // DisplayName A user-friendly name for the collection + DisplayName *string `json:"displayName,omitempty"` + + // Slug A lowercase name identifying the collection. + Slug string `json:"slug"` +} + // NewGrant The body of a request to add a grant to a group. type NewGrant struct { // GroupID A UUID identifying the group this grant is attached to @@ -378,15 +632,6 @@ type NewGrant struct { Value *string `json:"value,omitempty"` } -// NewInventory A collection of items -type NewInventory struct { - // DisplayName A user-friendly name for the inventory - DisplayName *string `json:"displayName,omitempty"` - - // Slug A lowercase name identifying the inventory. - Slug string `json:"slug"` -} - // NewTag The body of a request to add a tag to a host. type NewTag struct { // Name The key for the host tag @@ -528,15 +773,64 @@ type ProvisionerClaims struct { // ProvisionerOptions Options that apply when issuing certificates with this provisioner type ProvisionerOptions struct { // Ssh Options that apply when issuing SSH certificates - Ssh *SshOptions `json:"ssh,omitempty"` - - // Webhooks Configuration for a webhook to be called when issuing certificates with this provisioner - Webhooks *Webhook `json:"webhooks,omitempty"` + Ssh *SshOptions `json:"ssh,omitempty"` + Webhooks *[]ProvisionerWebhook `json:"webhooks,omitempty"` // X509 Options that apply when issuing x509 certificates X509 *X509Options `json:"x509,omitempty"` } +// ProvisionerWebhook A [webhook](https://smallstep.com/docs/step-ca/webhooks/) to call when a certificate request is being processed. +type ProvisionerWebhook struct { + // BasicAuth Configures provisioner webhook requests to include an Authorization header with these credentials. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. At most one of `bearerToken` and `basicAuth` may be set. + BasicAuth *BasicAuth `json:"basicAuth,omitempty"` + + // BearerToken Webhook requests will include an Authorization header with the token. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. At most one of `bearerToken` and `basicAuth` may be set. + BearerToken *string `json:"bearerToken,omitempty"` + CertType ProvisionerWebhookCertType `json:"certType"` + + // CollectionSlug For HOSTED_ATTESTATION webhooks, the collectionSlug is a reference to the collection that holds the devices that may be issued certificates. This collection must already exist. Required for `HOSTED_ATTESTATION` webhook servers; not allowed for `EXTERNAL`. + CollectionSlug *string `json:"collectionSlug,omitempty"` + + // DisableTLSClientAuth The CA will not send a client certificate when requested by the webhook server. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. + DisableTLSClientAuth *bool `json:"disableTLSClientAuth,omitempty"` + + // Id UUID identifying this webhook. Generated server-side when the webhook is created. Will be sent to the webhook server in every request in the `X-Smallstep-Webhook-ID` header. + Id *string `json:"id,omitempty"` + + // Kind The webhook kind indicates how and when it is called. + // + // ENRICHING webhooks are called before rendering the certificate template. They have two functions. First, they must allow the certificate request or it will be aborted. Second, they can return additional data to be referenced in the certificate template. The payload sent to the webhook server varies based on whether an X509 or SSH certificate is to be signed and based on the type of provisioner. + Kind ProvisionerWebhookKind `json:"kind"` + + // Name The name of the webhook. For `ENRICHING` webhooks, the returned data can be referenced in the certificate under the path `.Webhooks.<name>`. Must be unique to the provisioner. + Name string `json:"name"` + + // Secret The shared secret used to authenticate the payload sent to the webhook server. Generated server-side. This is returned only for `EXTERNAL` webhook servers and only once, at the time of creation. + Secret *string `json:"secret,omitempty"` + + // ServerType An EXTERNAL webhook server is not operated by Smallstep. The caller must use the returned ID and secret to configure the server. + // + // A HOSTED_ATTESTATION webhook server is hosted by Smallstep and must be used with an `ENRICHING` webhook type and an ACME Attestation provisioner. The webhook server will verify the attested permanent identifier exists as the ID of an instance in the configured collection. The data of the instance in the collection will be added to the template data. + ServerType ProvisionerWebhookServerType `json:"serverType"` + + // Url The URL of the webhook server. Required for `EXTERNAL` webhook servers; read-only for hosted webhook servers. + Url *string `json:"url,omitempty"` +} + +// ProvisionerWebhookCertType defines model for ProvisionerWebhook.CertType. +type ProvisionerWebhookCertType string + +// ProvisionerWebhookKind The webhook kind indicates how and when it is called. +// +// ENRICHING webhooks are called before rendering the certificate template. They have two functions. First, they must allow the certificate request or it will be aborted. Second, they can return additional data to be referenced in the certificate template. The payload sent to the webhook server varies based on whether an X509 or SSH certificate is to be signed and based on the type of provisioner. +type ProvisionerWebhookKind string + +// ProvisionerWebhookServerType An EXTERNAL webhook server is not operated by Smallstep. The caller must use the returned ID and secret to configure the server. +// +// A HOSTED_ATTESTATION webhook server is hosted by Smallstep and must be used with an `ENRICHING` webhook type and an ACME Attestation provisioner. The webhook server will verify the attested permanent identifier exists as the ID of an instance in the configured collection. The data of the instance in the collection will be added to the template data. +type ProvisionerWebhookServerType string + // SshOptions Options that apply when issuing SSH certificates type SshOptions struct { // Template A JSON representation of the SSH certificate to be created. [More info](https://smallstep.com/docs/step-ca/templates/#ssh-templates). @@ -580,27 +874,6 @@ type User struct { PosixUsers *[]PosixUser `json:"posixUsers,omitempty"` } -// Webhook Configuration for a webhook to be called when issuing certificates with this provisioner -type Webhook struct { - // CertType Whether to call this webhook when signing X509 certificates, SSH certificates, or ALL certificates. Default is ALL. - CertType *WebhookCertType `json:"certType,omitempty"` - - // DisableTLSClientAuth The CA will not send a client certificate when requested by the webhook server. - DisableTLSClientAuth *bool `json:"disableTLSClientAuth,omitempty"` - - // Id UUID identifying this webhook. Generated server-side when the webhook is created. - Id *string `json:"id,omitempty"` - - // Name The name of the webhook. - Name *string `json:"name,omitempty"` - - // Url The URL of the webhook server. - Url *string `json:"url,omitempty"` -} - -// WebhookCertType Whether to call this webhook when signing X509 certificates, SSH certificates, or ALL certificates. Default is ALL. -type WebhookCertType string - // X509Issuer A Customized X509 issuer for an authority type X509Issuer struct { // Duration The certificate lifetime. Parsed as a [Golang duration](https://pkg.go.dev/time#ParseDuration). @@ -639,12 +912,21 @@ type X5cProvisioner struct { // Accept defines model for accept. type Accept = string +// AgentConfigurationID defines model for agentConfigurationID. +type AgentConfigurationID = string + // AttestationAuthorityID defines model for attestationAuthorityID. type AttestationAuthorityID = string // AuthorityID defines model for authorityID. type AuthorityID = string +// CollectionSlug defines model for collectionSlug. +type CollectionSlug = string + +// EndpointConfigurationID defines model for endpointConfigurationID. +type EndpointConfigurationID = string + // GrantID defines model for grantID. type GrantID = string @@ -654,11 +936,14 @@ type GroupID = string // HostID defines model for hostID. type HostID = string -// InventorySlug defines model for inventorySlug. -type InventorySlug = string +// InstanceID defines model for instanceID. +type InstanceID = string + +// ManagedConfigurationHostID defines model for managedConfigurationHostID. +type ManagedConfigurationHostID = string -// ItemID defines model for itemID. -type ItemID = string +// ManagedConfigurationID defines model for managedConfigurationID. +type ManagedConfigurationID = string // Pagination defines model for pagination. type Pagination struct { @@ -677,6 +962,9 @@ type ProvisionerNameOrID = string // RequestID defines model for requestID. type RequestID = string +// WebhookNameOrID defines model for webhookNameOrID. +type WebhookNameOrID = string + // N400 defines model for 400. type N400 = Error @@ -698,6 +986,33 @@ type N412 = Error // N500 defines model for 500. type N500 = Error +// PostAgentConfigurationsParams defines parameters for PostAgentConfigurations. +type PostAgentConfigurationsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// DeleteAgentConfigurationParams defines parameters for DeleteAgentConfiguration. +type DeleteAgentConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetAgentConfigurationParams defines parameters for GetAgentConfiguration. +type GetAgentConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + // GetAttestationAuthoritiesParams defines parameters for GetAttestationAuthorities. type GetAttestationAuthoritiesParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. @@ -825,6 +1140,33 @@ type GetProvisionerParams struct { Accept *Accept `json:"Accept,omitempty"` } +// PostWebhooksParams defines parameters for PostWebhooks. +type PostWebhooksParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// DeleteWebhookParams defines parameters for DeleteWebhook. +type DeleteWebhookParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetWebhookParams defines parameters for GetWebhook. +type GetWebhookParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + // PostAuthorityRootJSONBody defines parameters for PostAuthorityRoot. type PostAuthorityRootJSONBody struct { // AdminEmails Users that will have admin access to manage the authority @@ -852,8 +1194,11 @@ type PostAuthorityRootParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGrantsParams defines parameters for GetSshGrants. -type GetSshGrantsParams struct { +// ListCollectionsParams defines parameters for ListCollections. +type ListCollectionsParams struct { + // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` + Pagination *Pagination `json:"pagination,omitempty"` + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -861,8 +1206,8 @@ type GetSshGrantsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PostSshGrantsParams defines parameters for PostSshGrants. -type PostSshGrantsParams struct { +// PostCollectionsParams defines parameters for PostCollections. +type PostCollectionsParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -870,8 +1215,8 @@ type PostSshGrantsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// DeleteSshGrantParams defines parameters for DeleteSshGrant. -type DeleteSshGrantParams struct { +// DeleteCollectionParams defines parameters for DeleteCollection. +type DeleteCollectionParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -879,8 +1224,8 @@ type DeleteSshGrantParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGrantParams defines parameters for GetSshGrant. -type GetSshGrantParams struct { +// GetCollectionParams defines parameters for GetCollection. +type GetCollectionParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -888,11 +1233,8 @@ type GetSshGrantParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGroupsParams defines parameters for GetSshGroups. -type GetSshGroupsParams struct { - // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` - Pagination *Pagination `json:"pagination,omitempty"` - +// DeleteCollectionInstanceParams defines parameters for DeleteCollectionInstance. +type DeleteCollectionInstanceParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -900,8 +1242,8 @@ type GetSshGroupsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGroupParams defines parameters for GetSshGroup. -type GetSshGroupParams struct { +// GetCollectionInstanceParams defines parameters for GetCollectionInstance. +type GetCollectionInstanceParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -909,17 +1251,13 @@ type GetSshGroupParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshHostsParams defines parameters for GetSshHosts. -type GetSshHostsParams struct { - // Active If unset or set to true the results will only include active hosts. If set to false the results will include both active and inactive hosts. - Active *bool `form:"active,omitempty" json:"active,omitempty"` - - // Bastion Filter (non-)bastion hosts. If unset the results will include both bastion and non-bastion hosts. If set to true the results will include only bastion hosts and if set to false the results will include only non-bastion hosts. - Bastion *bool `form:"bastion,omitempty" json:"bastion,omitempty"` - - // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` - Pagination *Pagination `json:"pagination,omitempty"` +// PutCollectionInstanceJSONBody defines parameters for PutCollectionInstance. +type PutCollectionInstanceJSONBody struct { + Data interface{} `json:"data"` +} +// PutCollectionInstanceParams defines parameters for PutCollectionInstance. +type PutCollectionInstanceParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -927,8 +1265,8 @@ type GetSshHostsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshHostParams defines parameters for GetSshHost. -type GetSshHostParams struct { +// GetCollectionInstanceDataParams defines parameters for GetCollectionInstanceData. +type GetCollectionInstanceDataParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -936,8 +1274,11 @@ type GetSshHostParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PostHostsHostIDTagsParams defines parameters for PostHostsHostIDTags. -type PostHostsHostIDTagsParams struct { +// PutCollectionInstanceDataJSONBody defines parameters for PutCollectionInstanceData. +type PutCollectionInstanceDataJSONBody = interface{} + +// PutCollectionInstanceDataParams defines parameters for PutCollectionInstanceData. +type PutCollectionInstanceDataParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -945,8 +1286,11 @@ type PostHostsHostIDTagsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// UnregisterSshHostParams defines parameters for UnregisterSshHost. -type UnregisterSshHostParams struct { +// ListCollectionInstancesParams defines parameters for ListCollectionInstances. +type ListCollectionInstancesParams struct { + // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` + Pagination *Pagination `json:"pagination,omitempty"` + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -954,11 +1298,35 @@ type UnregisterSshHostParams struct { Accept *Accept `json:"Accept,omitempty"` } -// ListInventoriesParams defines parameters for ListInventories. -type ListInventoriesParams struct { - // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` - Pagination *Pagination `json:"pagination,omitempty"` +// PostEndpointConfigurationsParams defines parameters for PostEndpointConfigurations. +type PostEndpointConfigurationsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// DeleteEndpointConfigurationParams defines parameters for DeleteEndpointConfiguration. +type DeleteEndpointConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetEndpointConfigurationParams defines parameters for GetEndpointConfiguration. +type GetEndpointConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} +// GetSshGrantsParams defines parameters for GetSshGrants. +type GetSshGrantsParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -966,8 +1334,8 @@ type ListInventoriesParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PostInventoriesParams defines parameters for PostInventories. -type PostInventoriesParams struct { +// PostSshGrantsParams defines parameters for PostSshGrants. +type PostSshGrantsParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -975,8 +1343,8 @@ type PostInventoriesParams struct { Accept *Accept `json:"Accept,omitempty"` } -// DeleteInventoryParams defines parameters for DeleteInventory. -type DeleteInventoryParams struct { +// DeleteSshGrantParams defines parameters for DeleteSshGrant. +type DeleteSshGrantParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -984,8 +1352,8 @@ type DeleteInventoryParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetInventoryParams defines parameters for GetInventory. -type GetInventoryParams struct { +// GetSshGrantParams defines parameters for GetSshGrant. +type GetSshGrantParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -993,8 +1361,8 @@ type GetInventoryParams struct { Accept *Accept `json:"Accept,omitempty"` } -// ListInventoryItemsParams defines parameters for ListInventoryItems. -type ListInventoryItemsParams struct { +// GetSshGroupsParams defines parameters for GetSshGroups. +type GetSshGroupsParams struct { // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` Pagination *Pagination `json:"pagination,omitempty"` @@ -1005,8 +1373,26 @@ type ListInventoryItemsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// DeleteInventoryItemParams defines parameters for DeleteInventoryItem. -type DeleteInventoryItemParams struct { +// GetSshGroupParams defines parameters for GetSshGroup. +type GetSshGroupParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetSshHostsParams defines parameters for GetSshHosts. +type GetSshHostsParams struct { + // Active If unset or set to true the results will only include active hosts. If set to false the results will include both active and inactive hosts. + Active *bool `form:"active,omitempty" json:"active,omitempty"` + + // Bastion Filter (non-)bastion hosts. If unset the results will include both bastion and non-bastion hosts. If set to true the results will include only bastion hosts and if set to false the results will include only non-bastion hosts. + Bastion *bool `form:"bastion,omitempty" json:"bastion,omitempty"` + + // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` + Pagination *Pagination `json:"pagination,omitempty"` + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1014,8 +1400,8 @@ type DeleteInventoryItemParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetInventoryItemParams defines parameters for GetInventoryItem. -type GetInventoryItemParams struct { +// GetSshHostParams defines parameters for GetSshHost. +type GetSshHostParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1023,13 +1409,35 @@ type GetInventoryItemParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PutInventoryItemJSONBody defines parameters for PutInventoryItem. -type PutInventoryItemJSONBody struct { - Data interface{} `json:"data"` +// PostHostsHostIDTagsParams defines parameters for PostHostsHostIDTags. +type PostHostsHostIDTagsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// UnregisterSshHostParams defines parameters for UnregisterSshHost. +type UnregisterSshHostParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// PostManagedConfigurationsParams defines parameters for PostManagedConfigurations. +type PostManagedConfigurationsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` } -// PutInventoryItemParams defines parameters for PutInventoryItem. -type PutInventoryItemParams struct { +// DeleteManagedConfigurationHostIdParams defines parameters for DeleteManagedConfigurationHostId. +type DeleteManagedConfigurationHostIdParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1037,8 +1445,8 @@ type PutInventoryItemParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetInventoryItemDataParams defines parameters for GetInventoryItemData. -type GetInventoryItemDataParams struct { +// GetManagedConfigurationHostIdParams defines parameters for GetManagedConfigurationHostId. +type GetManagedConfigurationHostIdParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1046,11 +1454,17 @@ type GetInventoryItemDataParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PutInventoryItemDataJSONBody defines parameters for PutInventoryItemData. -type PutInventoryItemDataJSONBody = interface{} +// DeleteManagedConfigurationParams defines parameters for DeleteManagedConfiguration. +type DeleteManagedConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} -// PutInventoryItemDataParams defines parameters for PutInventoryItemData. -type PutInventoryItemDataParams struct { +// GetManagedConfigurationParams defines parameters for GetManagedConfiguration. +type GetManagedConfigurationParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1082,6 +1496,9 @@ type GetSshUsersParams struct { Accept *Accept `json:"Accept,omitempty"` } +// PostAgentConfigurationsJSONRequestBody defines body for PostAgentConfigurations for application/json ContentType. +type PostAgentConfigurationsJSONRequestBody = AgentConfiguration + // PostAttestationAuthoritiesJSONRequestBody defines body for PostAttestationAuthorities for application/json ContentType. type PostAttestationAuthoritiesJSONRequestBody = AttestationAuthority @@ -1097,23 +1514,32 @@ type PostAuthoritiesCsrJSONRequestBody = NewAuthorityCsr // PostAuthorityProvisionersJSONRequestBody defines body for PostAuthorityProvisioners for application/json ContentType. type PostAuthorityProvisionersJSONRequestBody = Provisioner +// PostWebhooksJSONRequestBody defines body for PostWebhooks for application/json ContentType. +type PostWebhooksJSONRequestBody = ProvisionerWebhook + // PostAuthorityRootJSONRequestBody defines body for PostAuthorityRoot for application/json ContentType. type PostAuthorityRootJSONRequestBody PostAuthorityRootJSONBody +// PostCollectionsJSONRequestBody defines body for PostCollections for application/json ContentType. +type PostCollectionsJSONRequestBody = NewCollection + +// PutCollectionInstanceJSONRequestBody defines body for PutCollectionInstance for application/json ContentType. +type PutCollectionInstanceJSONRequestBody PutCollectionInstanceJSONBody + +// PutCollectionInstanceDataJSONRequestBody defines body for PutCollectionInstanceData for application/json ContentType. +type PutCollectionInstanceDataJSONRequestBody = PutCollectionInstanceDataJSONBody + +// PostEndpointConfigurationsJSONRequestBody defines body for PostEndpointConfigurations for application/json ContentType. +type PostEndpointConfigurationsJSONRequestBody = EndpointConfiguration + // PostSshGrantsJSONRequestBody defines body for PostSshGrants for application/json ContentType. type PostSshGrantsJSONRequestBody = NewGrant // PostHostsHostIDTagsJSONRequestBody defines body for PostHostsHostIDTags for application/json ContentType. type PostHostsHostIDTagsJSONRequestBody = NewTag -// PostInventoriesJSONRequestBody defines body for PostInventories for application/json ContentType. -type PostInventoriesJSONRequestBody = NewInventory - -// PutInventoryItemJSONRequestBody defines body for PutInventoryItem for application/json ContentType. -type PutInventoryItemJSONRequestBody PutInventoryItemJSONBody - -// PutInventoryItemDataJSONRequestBody defines body for PutInventoryItemData for application/json ContentType. -type PutInventoryItemDataJSONRequestBody = PutInventoryItemDataJSONBody +// PostManagedConfigurationsJSONRequestBody defines body for PostManagedConfigurations for application/json ContentType. +type PostManagedConfigurationsJSONRequestBody = ManagedConfiguration // AsOidcProvisioner returns the union data inside the Provisioner as a OidcProvisioner func (t Provisioner) AsOidcProvisioner() (OidcProvisioner, error) { @@ -1429,6 +1855,17 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { + // PostAgentConfigurations request with any body + PostAgentConfigurationsWithBody(ctx context.Context, params *PostAgentConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostAgentConfigurations(ctx context.Context, params *PostAgentConfigurationsParams, body PostAgentConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteAgentConfiguration request + DeleteAgentConfiguration(ctx context.Context, agentConfigurationID AgentConfigurationID, params *DeleteAgentConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetAgentConfiguration request + GetAgentConfiguration(ctx context.Context, agentConfigurationID AgentConfigurationID, params *GetAgentConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetAttestationAuthorities request GetAttestationAuthorities(ctx context.Context, params *GetAttestationAuthoritiesParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1481,11 +1918,69 @@ type ClientInterface interface { // GetProvisioner request GetProvisioner(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostWebhooks request with any body + PostWebhooksWithBody(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostWebhooks(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, body PostWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteWebhook request + DeleteWebhook(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *DeleteWebhookParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetWebhook request + GetWebhook(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *GetWebhookParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostAuthorityRoot request with any body PostAuthorityRootWithBody(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostAuthorityRoot(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListCollections request + ListCollections(ctx context.Context, params *ListCollectionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostCollections request with any body + PostCollectionsWithBody(ctx context.Context, params *PostCollectionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostCollections(ctx context.Context, params *PostCollectionsParams, body PostCollectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteCollection request + DeleteCollection(ctx context.Context, collectionSlug CollectionSlug, params *DeleteCollectionParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetCollection request + GetCollection(ctx context.Context, collectionSlug CollectionSlug, params *GetCollectionParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteCollectionInstance request + DeleteCollectionInstance(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *DeleteCollectionInstanceParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetCollectionInstance request + GetCollectionInstance(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutCollectionInstance request with any body + PutCollectionInstanceWithBody(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutCollectionInstance(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, body PutCollectionInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetCollectionInstanceData request + GetCollectionInstanceData(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceDataParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PutCollectionInstanceData request with any body + PutCollectionInstanceDataWithBody(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PutCollectionInstanceData(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, body PutCollectionInstanceDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListCollectionInstances request + ListCollectionInstances(ctx context.Context, collectionSlug CollectionSlug, params *ListCollectionInstancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PostEndpointConfigurations request with any body + PostEndpointConfigurationsWithBody(ctx context.Context, params *PostEndpointConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + PostEndpointConfigurations(ctx context.Context, params *PostEndpointConfigurationsParams, body PostEndpointConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteEndpointConfiguration request + DeleteEndpointConfiguration(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *DeleteEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEndpointConfiguration request + GetEndpointConfiguration(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *GetEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetSshGrants request GetSshGrants(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1520,41 +2015,22 @@ type ClientInterface interface { // UnregisterSshHost request UnregisterSshHost(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListInventories request - ListInventories(ctx context.Context, params *ListInventoriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostManagedConfigurations request with any body + PostManagedConfigurationsWithBody(ctx context.Context, params *PostManagedConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // PostInventories request with any body - PostInventoriesWithBody(ctx context.Context, params *PostInventoriesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + PostManagedConfigurations(ctx context.Context, params *PostManagedConfigurationsParams, body PostManagedConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - PostInventories(ctx context.Context, params *PostInventoriesParams, body PostInventoriesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteManagedConfigurationHostId request + DeleteManagedConfigurationHostId(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *DeleteManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteInventory request - DeleteInventory(ctx context.Context, inventorySlug InventorySlug, params *DeleteInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetManagedConfigurationHostId request + GetManagedConfigurationHostId(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *GetManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetInventory request - GetInventory(ctx context.Context, inventorySlug InventorySlug, params *GetInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteManagedConfiguration request + DeleteManagedConfiguration(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *DeleteManagedConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListInventoryItems request - ListInventoryItems(ctx context.Context, inventorySlug InventorySlug, params *ListInventoryItemsParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteInventoryItem request - DeleteInventoryItem(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *DeleteInventoryItemParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetInventoryItem request - GetInventoryItem(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutInventoryItem request with any body - PutInventoryItemWithBody(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutInventoryItem(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, body PutInventoryItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetInventoryItemData request - GetInventoryItemData(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemDataParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // PutInventoryItemData request with any body - PutInventoryItemDataWithBody(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - PutInventoryItemData(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, body PutInventoryItemDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetManagedConfiguration request + GetManagedConfiguration(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *GetManagedConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetSshHostTags request GetSshHostTags(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -1563,6 +2039,54 @@ type ClientInterface interface { GetSshUsers(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) } +func (c *Client) PostAgentConfigurationsWithBody(ctx context.Context, params *PostAgentConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostAgentConfigurationsRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) PostAgentConfigurations(ctx context.Context, params *PostAgentConfigurationsParams, body PostAgentConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostAgentConfigurationsRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteAgentConfiguration(ctx context.Context, agentConfigurationID AgentConfigurationID, params *DeleteAgentConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteAgentConfigurationRequest(c.Server, agentConfigurationID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetAgentConfiguration(ctx context.Context, agentConfigurationID AgentConfigurationID, params *GetAgentConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetAgentConfigurationRequest(c.Server, agentConfigurationID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetAttestationAuthorities(ctx context.Context, params *GetAttestationAuthoritiesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetAttestationAuthoritiesRequest(c.Server, params) if err != nil { @@ -1791,8 +2315,8 @@ func (c *Client) GetProvisioner(ctx context.Context, authorityID AuthorityID, pr return c.Client.Do(req) } -func (c *Client) PostAuthorityRootWithBody(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostAuthorityRootRequestWithBody(c.Server, authorityID, params, contentType, body) +func (c *Client) PostWebhooksWithBody(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostWebhooksRequestWithBody(c.Server, authorityID, provisionerNameOrID, params, contentType, body) if err != nil { return nil, err } @@ -1803,8 +2327,8 @@ func (c *Client) PostAuthorityRootWithBody(ctx context.Context, authorityID Auth return c.Client.Do(req) } -func (c *Client) PostAuthorityRoot(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostAuthorityRootRequest(c.Server, authorityID, params, body) +func (c *Client) PostWebhooks(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, body PostWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostWebhooksRequest(c.Server, authorityID, provisionerNameOrID, params, body) if err != nil { return nil, err } @@ -1815,8 +2339,8 @@ func (c *Client) PostAuthorityRoot(ctx context.Context, authorityID AuthorityID, return c.Client.Do(req) } -func (c *Client) GetSshGrants(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshGrantsRequest(c.Server, params) +func (c *Client) DeleteWebhook(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *DeleteWebhookParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteWebhookRequest(c.Server, authorityID, provisionerNameOrID, webhookNameOrID, params) if err != nil { return nil, err } @@ -1827,8 +2351,8 @@ func (c *Client) GetSshGrants(ctx context.Context, params *GetSshGrantsParams, r return c.Client.Do(req) } -func (c *Client) PostSshGrantsWithBody(ctx context.Context, params *PostSshGrantsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostSshGrantsRequestWithBody(c.Server, params, contentType, body) +func (c *Client) GetWebhook(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *GetWebhookParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWebhookRequest(c.Server, authorityID, provisionerNameOrID, webhookNameOrID, params) if err != nil { return nil, err } @@ -1839,8 +2363,8 @@ func (c *Client) PostSshGrantsWithBody(ctx context.Context, params *PostSshGrant return c.Client.Do(req) } -func (c *Client) PostSshGrants(ctx context.Context, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostSshGrantsRequest(c.Server, params, body) +func (c *Client) PostAuthorityRootWithBody(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostAuthorityRootRequestWithBody(c.Server, authorityID, params, contentType, body) if err != nil { return nil, err } @@ -1851,8 +2375,8 @@ func (c *Client) PostSshGrants(ctx context.Context, params *PostSshGrantsParams, return c.Client.Do(req) } -func (c *Client) DeleteSshGrant(ctx context.Context, grantID GrantID, params *DeleteSshGrantParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteSshGrantRequest(c.Server, grantID, params) +func (c *Client) PostAuthorityRoot(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostAuthorityRootRequest(c.Server, authorityID, params, body) if err != nil { return nil, err } @@ -1863,8 +2387,8 @@ func (c *Client) DeleteSshGrant(ctx context.Context, grantID GrantID, params *De return c.Client.Do(req) } -func (c *Client) GetSshGrant(ctx context.Context, grantID GrantID, params *GetSshGrantParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshGrantRequest(c.Server, grantID, params) +func (c *Client) ListCollections(ctx context.Context, params *ListCollectionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListCollectionsRequest(c.Server, params) if err != nil { return nil, err } @@ -1875,8 +2399,8 @@ func (c *Client) GetSshGrant(ctx context.Context, grantID GrantID, params *GetSs return c.Client.Do(req) } -func (c *Client) GetSshGroups(ctx context.Context, params *GetSshGroupsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshGroupsRequest(c.Server, params) +func (c *Client) PostCollectionsWithBody(ctx context.Context, params *PostCollectionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostCollectionsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -1887,8 +2411,8 @@ func (c *Client) GetSshGroups(ctx context.Context, params *GetSshGroupsParams, r return c.Client.Do(req) } -func (c *Client) GetSshGroup(ctx context.Context, groupID GroupID, params *GetSshGroupParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshGroupRequest(c.Server, groupID, params) +func (c *Client) PostCollections(ctx context.Context, params *PostCollectionsParams, body PostCollectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostCollectionsRequest(c.Server, params, body) if err != nil { return nil, err } @@ -1899,8 +2423,8 @@ func (c *Client) GetSshGroup(ctx context.Context, groupID GroupID, params *GetSs return c.Client.Do(req) } -func (c *Client) GetSshHosts(ctx context.Context, params *GetSshHostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshHostsRequest(c.Server, params) +func (c *Client) DeleteCollection(ctx context.Context, collectionSlug CollectionSlug, params *DeleteCollectionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteCollectionRequest(c.Server, collectionSlug, params) if err != nil { return nil, err } @@ -1911,8 +2435,8 @@ func (c *Client) GetSshHosts(ctx context.Context, params *GetSshHostsParams, req return c.Client.Do(req) } -func (c *Client) GetSshHost(ctx context.Context, hostID HostID, params *GetSshHostParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshHostRequest(c.Server, hostID, params) +func (c *Client) GetCollection(ctx context.Context, collectionSlug CollectionSlug, params *GetCollectionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetCollectionRequest(c.Server, collectionSlug, params) if err != nil { return nil, err } @@ -1923,8 +2447,8 @@ func (c *Client) GetSshHost(ctx context.Context, hostID HostID, params *GetSshHo return c.Client.Do(req) } -func (c *Client) PostHostsHostIDTagsWithBody(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostHostsHostIDTagsRequestWithBody(c.Server, hostID, params, contentType, body) +func (c *Client) DeleteCollectionInstance(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *DeleteCollectionInstanceParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteCollectionInstanceRequest(c.Server, collectionSlug, instanceID, params) if err != nil { return nil, err } @@ -1935,8 +2459,8 @@ func (c *Client) PostHostsHostIDTagsWithBody(ctx context.Context, hostID HostID, return c.Client.Do(req) } -func (c *Client) PostHostsHostIDTags(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostHostsHostIDTagsRequest(c.Server, hostID, params, body) +func (c *Client) GetCollectionInstance(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetCollectionInstanceRequest(c.Server, collectionSlug, instanceID, params) if err != nil { return nil, err } @@ -1947,8 +2471,8 @@ func (c *Client) PostHostsHostIDTags(ctx context.Context, hostID HostID, params return c.Client.Do(req) } -func (c *Client) UnregisterSshHost(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUnregisterSshHostRequest(c.Server, hostID, params) +func (c *Client) PutCollectionInstanceWithBody(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutCollectionInstanceRequestWithBody(c.Server, collectionSlug, instanceID, params, contentType, body) if err != nil { return nil, err } @@ -1959,8 +2483,8 @@ func (c *Client) UnregisterSshHost(ctx context.Context, hostID HostID, params *U return c.Client.Do(req) } -func (c *Client) ListInventories(ctx context.Context, params *ListInventoriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListInventoriesRequest(c.Server, params) +func (c *Client) PutCollectionInstance(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, body PutCollectionInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutCollectionInstanceRequest(c.Server, collectionSlug, instanceID, params, body) if err != nil { return nil, err } @@ -1971,8 +2495,8 @@ func (c *Client) ListInventories(ctx context.Context, params *ListInventoriesPar return c.Client.Do(req) } -func (c *Client) PostInventoriesWithBody(ctx context.Context, params *PostInventoriesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostInventoriesRequestWithBody(c.Server, params, contentType, body) +func (c *Client) GetCollectionInstanceData(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceDataParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetCollectionInstanceDataRequest(c.Server, collectionSlug, instanceID, params) if err != nil { return nil, err } @@ -1983,8 +2507,8 @@ func (c *Client) PostInventoriesWithBody(ctx context.Context, params *PostInvent return c.Client.Do(req) } -func (c *Client) PostInventories(ctx context.Context, params *PostInventoriesParams, body PostInventoriesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPostInventoriesRequest(c.Server, params, body) +func (c *Client) PutCollectionInstanceDataWithBody(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutCollectionInstanceDataRequestWithBody(c.Server, collectionSlug, instanceID, params, contentType, body) if err != nil { return nil, err } @@ -1995,8 +2519,8 @@ func (c *Client) PostInventories(ctx context.Context, params *PostInventoriesPar return c.Client.Do(req) } -func (c *Client) DeleteInventory(ctx context.Context, inventorySlug InventorySlug, params *DeleteInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteInventoryRequest(c.Server, inventorySlug, params) +func (c *Client) PutCollectionInstanceData(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, body PutCollectionInstanceDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutCollectionInstanceDataRequest(c.Server, collectionSlug, instanceID, params, body) if err != nil { return nil, err } @@ -2007,8 +2531,8 @@ func (c *Client) DeleteInventory(ctx context.Context, inventorySlug InventorySlu return c.Client.Do(req) } -func (c *Client) GetInventory(ctx context.Context, inventorySlug InventorySlug, params *GetInventoryParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetInventoryRequest(c.Server, inventorySlug, params) +func (c *Client) ListCollectionInstances(ctx context.Context, collectionSlug CollectionSlug, params *ListCollectionInstancesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListCollectionInstancesRequest(c.Server, collectionSlug, params) if err != nil { return nil, err } @@ -2019,8 +2543,8 @@ func (c *Client) GetInventory(ctx context.Context, inventorySlug InventorySlug, return c.Client.Do(req) } -func (c *Client) ListInventoryItems(ctx context.Context, inventorySlug InventorySlug, params *ListInventoryItemsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListInventoryItemsRequest(c.Server, inventorySlug, params) +func (c *Client) PostEndpointConfigurationsWithBody(ctx context.Context, params *PostEndpointConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEndpointConfigurationsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -2031,8 +2555,8 @@ func (c *Client) ListInventoryItems(ctx context.Context, inventorySlug Inventory return c.Client.Do(req) } -func (c *Client) DeleteInventoryItem(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *DeleteInventoryItemParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteInventoryItemRequest(c.Server, inventorySlug, itemID, params) +func (c *Client) PostEndpointConfigurations(ctx context.Context, params *PostEndpointConfigurationsParams, body PostEndpointConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostEndpointConfigurationsRequest(c.Server, params, body) if err != nil { return nil, err } @@ -2043,8 +2567,8 @@ func (c *Client) DeleteInventoryItem(ctx context.Context, inventorySlug Inventor return c.Client.Do(req) } -func (c *Client) GetInventoryItem(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetInventoryItemRequest(c.Server, inventorySlug, itemID, params) +func (c *Client) DeleteEndpointConfiguration(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *DeleteEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteEndpointConfigurationRequest(c.Server, endpointConfigurationID, params) if err != nil { return nil, err } @@ -2055,8 +2579,8 @@ func (c *Client) GetInventoryItem(ctx context.Context, inventorySlug InventorySl return c.Client.Do(req) } -func (c *Client) PutInventoryItemWithBody(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutInventoryItemRequestWithBody(c.Server, inventorySlug, itemID, params, contentType, body) +func (c *Client) GetEndpointConfiguration(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *GetEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEndpointConfigurationRequest(c.Server, endpointConfigurationID, params) if err != nil { return nil, err } @@ -2067,8 +2591,8 @@ func (c *Client) PutInventoryItemWithBody(ctx context.Context, inventorySlug Inv return c.Client.Do(req) } -func (c *Client) PutInventoryItem(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, body PutInventoryItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutInventoryItemRequest(c.Server, inventorySlug, itemID, params, body) +func (c *Client) GetSshGrants(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshGrantsRequest(c.Server, params) if err != nil { return nil, err } @@ -2079,8 +2603,8 @@ func (c *Client) PutInventoryItem(ctx context.Context, inventorySlug InventorySl return c.Client.Do(req) } -func (c *Client) GetInventoryItemData(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemDataParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetInventoryItemDataRequest(c.Server, inventorySlug, itemID, params) +func (c *Client) PostSshGrantsWithBody(ctx context.Context, params *PostSshGrantsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSshGrantsRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -2091,8 +2615,8 @@ func (c *Client) GetInventoryItemData(ctx context.Context, inventorySlug Invento return c.Client.Do(req) } -func (c *Client) PutInventoryItemDataWithBody(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutInventoryItemDataRequestWithBody(c.Server, inventorySlug, itemID, params, contentType, body) +func (c *Client) PostSshGrants(ctx context.Context, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostSshGrantsRequest(c.Server, params, body) if err != nil { return nil, err } @@ -2103,8 +2627,8 @@ func (c *Client) PutInventoryItemDataWithBody(ctx context.Context, inventorySlug return c.Client.Do(req) } -func (c *Client) PutInventoryItemData(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, body PutInventoryItemDataJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewPutInventoryItemDataRequest(c.Server, inventorySlug, itemID, params, body) +func (c *Client) DeleteSshGrant(ctx context.Context, grantID GrantID, params *DeleteSshGrantParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteSshGrantRequest(c.Server, grantID, params) if err != nil { return nil, err } @@ -2115,8 +2639,8 @@ func (c *Client) PutInventoryItemData(ctx context.Context, inventorySlug Invento return c.Client.Do(req) } -func (c *Client) GetSshHostTags(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshHostTagsRequest(c.Server, params) +func (c *Client) GetSshGrant(ctx context.Context, grantID GrantID, params *GetSshGrantParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshGrantRequest(c.Server, grantID, params) if err != nil { return nil, err } @@ -2127,8 +2651,8 @@ func (c *Client) GetSshHostTags(ctx context.Context, params *GetSshHostTagsParam return c.Client.Do(req) } -func (c *Client) GetSshUsers(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetSshUsersRequest(c.Server, params) +func (c *Client) GetSshGroups(ctx context.Context, params *GetSshGroupsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshGroupsRequest(c.Server, params) if err != nil { return nil, err } @@ -2139,68 +2663,187 @@ func (c *Client) GetSshUsers(ctx context.Context, params *GetSshUsersParams, req return c.Client.Do(req) } -// NewGetAttestationAuthoritiesRequest generates requests for GetAttestationAuthorities -func NewGetAttestationAuthoritiesRequest(server string, params *GetAttestationAuthoritiesParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *Client) GetSshGroup(ctx context.Context, groupID GroupID, params *GetSshGroupParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshGroupRequest(c.Server, groupID, params) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/attestation-authorities") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) GetSshHosts(ctx context.Context, params *GetSshHostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshHostsRequest(c.Server, params) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - req, err := http.NewRequest("GET", queryURL.String(), nil) +func (c *Client) GetSshHost(ctx context.Context, hostID HostID, params *GetSshHostParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshHostRequest(c.Server, hostID, params) if err != nil { return nil, err } - - if params.XRequestId != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) - if err != nil { - return nil, err - } - - req.Header.Set("X-Request-Id", headerParam0) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - if params.Accept != nil { - var headerParam1 string +func (c *Client) PostHostsHostIDTagsWithBody(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostHostsHostIDTagsRequestWithBody(c.Server, hostID, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) - if err != nil { - return nil, err - } +func (c *Client) PostHostsHostIDTags(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostHostsHostIDTagsRequest(c.Server, hostID, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - req.Header.Set("Accept", headerParam1) +func (c *Client) UnregisterSshHost(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUnregisterSshHostRequest(c.Server, hostID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - return req, nil +func (c *Client) PostManagedConfigurationsWithBody(ctx context.Context, params *PostManagedConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostManagedConfigurationsRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewPostAttestationAuthoritiesRequest calls the generic PostAttestationAuthorities builder with application/json body -func NewPostAttestationAuthoritiesRequest(server string, params *PostAttestationAuthoritiesParams, body PostAttestationAuthoritiesJSONRequestBody) (*http.Request, error) { +func (c *Client) PostManagedConfigurations(ctx context.Context, params *PostManagedConfigurationsParams, body PostManagedConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostManagedConfigurationsRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteManagedConfigurationHostId(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *DeleteManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteManagedConfigurationHostIdRequest(c.Server, managedConfigurationHostID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetManagedConfigurationHostId(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *GetManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetManagedConfigurationHostIdRequest(c.Server, managedConfigurationHostID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteManagedConfiguration(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *DeleteManagedConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteManagedConfigurationRequest(c.Server, managedConfigurationID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetManagedConfiguration(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *GetManagedConfigurationParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetManagedConfigurationRequest(c.Server, managedConfigurationID, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetSshHostTags(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshHostTagsRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetSshUsers(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetSshUsersRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewPostAgentConfigurationsRequest calls the generic PostAgentConfigurations builder with application/json body +func NewPostAgentConfigurationsRequest(server string, params *PostAgentConfigurationsParams, body PostAgentConfigurationsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPostAttestationAuthoritiesRequestWithBody(server, params, "application/json", bodyReader) + return NewPostAgentConfigurationsRequestWithBody(server, params, "application/json", bodyReader) } -// NewPostAttestationAuthoritiesRequestWithBody generates requests for PostAttestationAuthorities with any type of body -func NewPostAttestationAuthoritiesRequestWithBody(server string, params *PostAttestationAuthoritiesParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostAgentConfigurationsRequestWithBody generates requests for PostAgentConfigurations with any type of body +func NewPostAgentConfigurationsRequestWithBody(server string, params *PostAgentConfigurationsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -2208,7 +2851,7 @@ func NewPostAttestationAuthoritiesRequestWithBody(server string, params *PostAtt return nil, err } - operationPath := fmt.Sprintf("/attestation-authorities") + operationPath := fmt.Sprintf("/agent-configurations") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2250,13 +2893,13 @@ func NewPostAttestationAuthoritiesRequestWithBody(server string, params *PostAtt return req, nil } -// NewDeleteAttestationAuthorityRequest generates requests for DeleteAttestationAuthority -func NewDeleteAttestationAuthorityRequest(server string, attestationAuthorityID AttestationAuthorityID, params *DeleteAttestationAuthorityParams) (*http.Request, error) { +// NewDeleteAgentConfigurationRequest generates requests for DeleteAgentConfiguration +func NewDeleteAgentConfigurationRequest(server string, agentConfigurationID AgentConfigurationID, params *DeleteAgentConfigurationParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, attestationAuthorityID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "agentConfigurationID", runtime.ParamLocationPath, agentConfigurationID) if err != nil { return nil, err } @@ -2266,7 +2909,7 @@ func NewDeleteAttestationAuthorityRequest(server string, attestationAuthorityID return nil, err } - operationPath := fmt.Sprintf("/attestation-authorities/%s", pathParam0) + operationPath := fmt.Sprintf("/agent-configurations/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2306,13 +2949,13 @@ func NewDeleteAttestationAuthorityRequest(server string, attestationAuthorityID return req, nil } -// NewGetAttestationAuthorityRequest generates requests for GetAttestationAuthority -func NewGetAttestationAuthorityRequest(server string, attestationAuthorityID AttestationAuthorityID, params *GetAttestationAuthorityParams) (*http.Request, error) { +// NewGetAgentConfigurationRequest generates requests for GetAgentConfiguration +func NewGetAgentConfigurationRequest(server string, agentConfigurationID AgentConfigurationID, params *GetAgentConfigurationParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, attestationAuthorityID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "agentConfigurationID", runtime.ParamLocationPath, agentConfigurationID) if err != nil { return nil, err } @@ -2322,7 +2965,7 @@ func NewGetAttestationAuthorityRequest(server string, attestationAuthorityID Att return nil, err } - operationPath := fmt.Sprintf("/attestation-authorities/%s", pathParam0) + operationPath := fmt.Sprintf("/agent-configurations/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2362,48 +3005,8 @@ func NewGetAttestationAuthorityRequest(server string, attestationAuthorityID Att return req, nil } -// NewPostAuthRequest calls the generic PostAuth builder with application/json body -func NewPostAuthRequest(server string, body PostAuthJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostAuthRequestWithBody(server, "application/json", bodyReader) -} - -// NewPostAuthRequestWithBody generates requests for PostAuth with any type of body -func NewPostAuthRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/auth") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetAuthoritiesRequest generates requests for GetAuthorities -func NewGetAuthoritiesRequest(server string, params *GetAuthoritiesParams) (*http.Request, error) { +// NewGetAttestationAuthoritiesRequest generates requests for GetAttestationAuthorities +func NewGetAttestationAuthoritiesRequest(server string, params *GetAttestationAuthoritiesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -2411,7 +3014,7 @@ func NewGetAuthoritiesRequest(server string, params *GetAuthoritiesParams) (*htt return nil, err } - operationPath := fmt.Sprintf("/authorities") + operationPath := fmt.Sprintf("/attestation-authorities") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2451,19 +3054,19 @@ func NewGetAuthoritiesRequest(server string, params *GetAuthoritiesParams) (*htt return req, nil } -// NewPostAuthoritiesRequest calls the generic PostAuthorities builder with application/json body -func NewPostAuthoritiesRequest(server string, params *PostAuthoritiesParams, body PostAuthoritiesJSONRequestBody) (*http.Request, error) { +// NewPostAttestationAuthoritiesRequest calls the generic PostAttestationAuthorities builder with application/json body +func NewPostAttestationAuthoritiesRequest(server string, params *PostAttestationAuthoritiesParams, body PostAttestationAuthoritiesJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPostAuthoritiesRequestWithBody(server, params, "application/json", bodyReader) + return NewPostAttestationAuthoritiesRequestWithBody(server, params, "application/json", bodyReader) } -// NewPostAuthoritiesRequestWithBody generates requests for PostAuthorities with any type of body -func NewPostAuthoritiesRequestWithBody(server string, params *PostAuthoritiesParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostAttestationAuthoritiesRequestWithBody generates requests for PostAttestationAuthorities with any type of body +func NewPostAttestationAuthoritiesRequestWithBody(server string, params *PostAttestationAuthoritiesParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -2471,7 +3074,7 @@ func NewPostAuthoritiesRequestWithBody(server string, params *PostAuthoritiesPar return nil, err } - operationPath := fmt.Sprintf("/authorities") + operationPath := fmt.Sprintf("/attestation-authorities") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2513,27 +3116,23 @@ func NewPostAuthoritiesRequestWithBody(server string, params *PostAuthoritiesPar return req, nil } -// NewPostAuthoritiesCsrRequest calls the generic PostAuthoritiesCsr builder with application/json body -func NewPostAuthoritiesCsrRequest(server string, params *PostAuthoritiesCsrParams, body PostAuthoritiesCsrJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +// NewDeleteAttestationAuthorityRequest generates requests for DeleteAttestationAuthority +func NewDeleteAttestationAuthorityRequest(server string, attestationAuthorityID AttestationAuthorityID, params *DeleteAttestationAuthorityParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, attestationAuthorityID) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewPostAuthoritiesCsrRequestWithBody(server, params, "application/json", bodyReader) -} - -// NewPostAuthoritiesCsrRequestWithBody generates requests for PostAuthoritiesCsr with any type of body -func NewPostAuthoritiesCsrRequestWithBody(server string, params *PostAuthoritiesCsrParams, contentType string, body io.Reader) (*http.Request, error) { - var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/authorities/csr") + operationPath := fmt.Sprintf("/attestation-authorities/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2543,13 +3142,11 @@ func NewPostAuthoritiesCsrRequestWithBody(server string, params *PostAuthorities return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - if params.XRequestId != nil { var headerParam0 string @@ -2575,13 +3172,13 @@ func NewPostAuthoritiesCsrRequestWithBody(server string, params *PostAuthorities return req, nil } -// NewDeleteAuthorityRequest generates requests for DeleteAuthority -func NewDeleteAuthorityRequest(server string, authorityID AuthorityID, params *DeleteAuthorityParams) (*http.Request, error) { +// NewGetAttestationAuthorityRequest generates requests for GetAttestationAuthority +func NewGetAttestationAuthorityRequest(server string, attestationAuthorityID AttestationAuthorityID, params *GetAttestationAuthorityParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, attestationAuthorityID) if err != nil { return nil, err } @@ -2591,7 +3188,7 @@ func NewDeleteAuthorityRequest(server string, authorityID AuthorityID, params *D return nil, err } - operationPath := fmt.Sprintf("/authorities/%s", pathParam0) + operationPath := fmt.Sprintf("/attestation-authorities/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2601,7 +3198,7 @@ func NewDeleteAuthorityRequest(server string, authorityID AuthorityID, params *D return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -2631,23 +3228,27 @@ func NewDeleteAuthorityRequest(server string, authorityID AuthorityID, params *D return req, nil } -// NewGetAuthorityRequest generates requests for GetAuthority -func NewGetAuthorityRequest(server string, authorityID AuthorityID, params *GetAuthorityParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) +// NewPostAuthRequest calls the generic PostAuth builder with application/json body +func NewPostAuthRequest(server string, body PostAuthJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewPostAuthRequestWithBody(server, "application/json", bodyReader) +} + +// NewPostAuthRequestWithBody generates requests for PostAuth with any type of body +func NewPostAuthRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/authorities/%s", pathParam0) + operationPath := fmt.Sprintf("/auth") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2657,53 +3258,26 @@ func NewGetAuthorityRequest(server string, authorityID AuthorityID, params *GetA return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } - if params.XRequestId != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) - if err != nil { - return nil, err - } - - req.Header.Set("X-Request-Id", headerParam0) - } - - if params.Accept != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", headerParam1) - } + req.Header.Add("Content-Type", contentType) return req, nil } -// NewListAuthorityProvisionersRequest generates requests for ListAuthorityProvisioners -func NewListAuthorityProvisionersRequest(server string, authorityID AuthorityID, params *ListAuthorityProvisionersParams) (*http.Request, error) { +// NewGetAuthoritiesRequest generates requests for GetAuthorities +func NewGetAuthoritiesRequest(server string, params *GetAuthoritiesParams) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/authorities/%s/provisioners", pathParam0) + operationPath := fmt.Sprintf("/authorities") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2743,34 +3317,27 @@ func NewListAuthorityProvisionersRequest(server string, authorityID AuthorityID, return req, nil } -// NewPostAuthorityProvisionersRequest calls the generic PostAuthorityProvisioners builder with application/json body -func NewPostAuthorityProvisionersRequest(server string, authorityID AuthorityID, params *PostAuthorityProvisionersParams, body PostAuthorityProvisionersJSONRequestBody) (*http.Request, error) { +// NewPostAuthoritiesRequest calls the generic PostAuthorities builder with application/json body +func NewPostAuthoritiesRequest(server string, params *PostAuthoritiesParams, body PostAuthoritiesJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPostAuthorityProvisionersRequestWithBody(server, authorityID, params, "application/json", bodyReader) + return NewPostAuthoritiesRequestWithBody(server, params, "application/json", bodyReader) } -// NewPostAuthorityProvisionersRequestWithBody generates requests for PostAuthorityProvisioners with any type of body -func NewPostAuthorityProvisionersRequestWithBody(server string, authorityID AuthorityID, params *PostAuthorityProvisionersParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostAuthoritiesRequestWithBody generates requests for PostAuthorities with any type of body +func NewPostAuthoritiesRequestWithBody(server string, params *PostAuthoritiesParams, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/authorities/%s/provisioners", pathParam0) + operationPath := fmt.Sprintf("/authorities") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2812,30 +3379,27 @@ func NewPostAuthorityProvisionersRequestWithBody(server string, authorityID Auth return req, nil } -// NewDeleteProvisionerRequest generates requests for DeleteProvisioner -func NewDeleteProvisionerRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *DeleteProvisionerParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) +// NewPostAuthoritiesCsrRequest calls the generic PostAuthoritiesCsr builder with application/json body +func NewPostAuthoritiesCsrRequest(server string, params *PostAuthoritiesCsrParams, body PostAuthoritiesCsrJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) if err != nil { return nil, err } + bodyReader = bytes.NewReader(buf) + return NewPostAuthoritiesCsrRequestWithBody(server, params, "application/json", bodyReader) +} - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) - if err != nil { - return nil, err - } +// NewPostAuthoritiesCsrRequestWithBody generates requests for PostAuthoritiesCsr with any type of body +func NewPostAuthoritiesCsrRequestWithBody(server string, params *PostAuthoritiesCsrParams, contentType string, body io.Reader) (*http.Request, error) { + var err error serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/authorities/csr") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2845,11 +3409,13 @@ func NewDeleteProvisionerRequest(server string, authorityID AuthorityID, provisi return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + if params.XRequestId != nil { var headerParam0 string @@ -2875,8 +3441,8 @@ func NewDeleteProvisionerRequest(server string, authorityID AuthorityID, provisi return req, nil } -// NewGetProvisionerRequest generates requests for GetProvisioner -func NewGetProvisionerRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams) (*http.Request, error) { +// NewDeleteAuthorityRequest generates requests for DeleteAuthority +func NewDeleteAuthorityRequest(server string, authorityID AuthorityID, params *DeleteAuthorityParams) (*http.Request, error) { var err error var pathParam0 string @@ -2886,19 +3452,12 @@ func NewGetProvisionerRequest(server string, authorityID AuthorityID, provisione return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/authorities/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2908,7 +3467,7 @@ func NewGetProvisionerRequest(server string, authorityID AuthorityID, provisione return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -2938,19 +3497,8 @@ func NewGetProvisionerRequest(server string, authorityID AuthorityID, provisione return req, nil } -// NewPostAuthorityRootRequest calls the generic PostAuthorityRoot builder with application/json body -func NewPostAuthorityRootRequest(server string, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewPostAuthorityRootRequestWithBody(server, authorityID, params, "application/json", bodyReader) -} - -// NewPostAuthorityRootRequestWithBody generates requests for PostAuthorityRoot with any type of body -func NewPostAuthorityRootRequestWithBody(server string, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader) (*http.Request, error) { +// NewGetAuthorityRequest generates requests for GetAuthority +func NewGetAuthorityRequest(server string, authorityID AuthorityID, params *GetAuthorityParams) (*http.Request, error) { var err error var pathParam0 string @@ -2965,7 +3513,7 @@ func NewPostAuthorityRootRequestWithBody(server string, authorityID AuthorityID, return nil, err } - operationPath := fmt.Sprintf("/authorities/%s/root", pathParam0) + operationPath := fmt.Sprintf("/authorities/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2975,13 +3523,11 @@ func NewPostAuthorityRootRequestWithBody(server string, authorityID AuthorityID, return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - if params.XRequestId != nil { var headerParam0 string @@ -3007,16 +3553,23 @@ func NewPostAuthorityRootRequestWithBody(server string, authorityID AuthorityID, return req, nil } -// NewGetSshGrantsRequest generates requests for GetSshGrants -func NewGetSshGrantsRequest(server string, params *GetSshGrantsParams) (*http.Request, error) { +// NewListAuthorityProvisionersRequest generates requests for ListAuthorityProvisioners +func NewListAuthorityProvisionersRequest(server string, authorityID AuthorityID, params *ListAuthorityProvisionersParams) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/grants") + operationPath := fmt.Sprintf("/authorities/%s/provisioners", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3056,27 +3609,34 @@ func NewGetSshGrantsRequest(server string, params *GetSshGrantsParams) (*http.Re return req, nil } -// NewPostSshGrantsRequest calls the generic PostSshGrants builder with application/json body -func NewPostSshGrantsRequest(server string, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody) (*http.Request, error) { +// NewPostAuthorityProvisionersRequest calls the generic PostAuthorityProvisioners builder with application/json body +func NewPostAuthorityProvisionersRequest(server string, authorityID AuthorityID, params *PostAuthorityProvisionersParams, body PostAuthorityProvisionersJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPostSshGrantsRequestWithBody(server, params, "application/json", bodyReader) + return NewPostAuthorityProvisionersRequestWithBody(server, authorityID, params, "application/json", bodyReader) } -// NewPostSshGrantsRequestWithBody generates requests for PostSshGrants with any type of body -func NewPostSshGrantsRequestWithBody(server string, params *PostSshGrantsParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostAuthorityProvisionersRequestWithBody generates requests for PostAuthorityProvisioners with any type of body +func NewPostAuthorityProvisionersRequestWithBody(server string, authorityID AuthorityID, params *PostAuthorityProvisionersParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/grants") + operationPath := fmt.Sprintf("/authorities/%s/provisioners", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3118,13 +3678,20 @@ func NewPostSshGrantsRequestWithBody(server string, params *PostSshGrantsParams, return req, nil } -// NewDeleteSshGrantRequest generates requests for DeleteSshGrant -func NewDeleteSshGrantRequest(server string, grantID GrantID, params *DeleteSshGrantParams) (*http.Request, error) { +// NewDeleteProvisionerRequest generates requests for DeleteProvisioner +func NewDeleteProvisionerRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *DeleteProvisionerParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "grantID", runtime.ParamLocationPath, grantID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) if err != nil { return nil, err } @@ -3134,7 +3701,7 @@ func NewDeleteSshGrantRequest(server string, grantID GrantID, params *DeleteSshG return nil, err } - operationPath := fmt.Sprintf("/grants/%s", pathParam0) + operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3174,13 +3741,20 @@ func NewDeleteSshGrantRequest(server string, grantID GrantID, params *DeleteSshG return req, nil } -// NewGetSshGrantRequest generates requests for GetSshGrant -func NewGetSshGrantRequest(server string, grantID GrantID, params *GetSshGrantParams) (*http.Request, error) { +// NewGetProvisionerRequest generates requests for GetProvisioner +func NewGetProvisionerRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "grantID", runtime.ParamLocationPath, grantID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) if err != nil { return nil, err } @@ -3190,7 +3764,7 @@ func NewGetSshGrantRequest(server string, grantID GrantID, params *GetSshGrantPa return nil, err } - operationPath := fmt.Sprintf("/grants/%s", pathParam0) + operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3230,16 +3804,41 @@ func NewGetSshGrantRequest(server string, grantID GrantID, params *GetSshGrantPa return req, nil } -// NewGetSshGroupsRequest generates requests for GetSshGroups -func NewGetSshGroupsRequest(server string, params *GetSshGroupsParams) (*http.Request, error) { +// NewPostWebhooksRequest calls the generic PostWebhooks builder with application/json body +func NewPostWebhooksRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, body PostWebhooksJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostWebhooksRequestWithBody(server, authorityID, provisionerNameOrID, params, "application/json", bodyReader) +} + +// NewPostWebhooksRequestWithBody generates requests for PostWebhooks with any type of body +func NewPostWebhooksRequestWithBody(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, contentType string, body io.Reader) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/groups") + operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s/webhooks", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3249,31 +3848,13 @@ func NewGetSshGroupsRequest(server string, params *GetSshGroupsParams) (*http.Re return nil, err } - queryValues := queryURL.Query() - - if params.Pagination != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + if params.XRequestId != nil { var headerParam0 string @@ -3299,13 +3880,27 @@ func NewGetSshGroupsRequest(server string, params *GetSshGroupsParams) (*http.Re return req, nil } -// NewGetSshGroupRequest generates requests for GetSshGroup -func NewGetSshGroupRequest(server string, groupID GroupID, params *GetSshGroupParams) (*http.Request, error) { +// NewDeleteWebhookRequest generates requests for DeleteWebhook +func NewDeleteWebhookRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *DeleteWebhookParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "groupID", runtime.ParamLocationPath, groupID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "webhookNameOrID", runtime.ParamLocationPath, webhookNameOrID) if err != nil { return nil, err } @@ -3315,7 +3910,7 @@ func NewGetSshGroupRequest(server string, groupID GroupID, params *GetSshGroupPa return nil, err } - operationPath := fmt.Sprintf("/groups/%s", pathParam0) + operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s/webhooks/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3325,7 +3920,7 @@ func NewGetSshGroupRequest(server string, groupID GroupID, params *GetSshGroupPa return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -3355,114 +3950,27 @@ func NewGetSshGroupRequest(server string, groupID GroupID, params *GetSshGroupPa return req, nil } -// NewGetSshHostsRequest generates requests for GetSshHosts -func NewGetSshHostsRequest(server string, params *GetSshHostsParams) (*http.Request, error) { +// NewGetWebhookRequest generates requests for GetWebhook +func NewGetWebhookRequest(server string, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *GetWebhookParams) (*http.Request, error) { var err error - serverURL, err := url.Parse(server) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/hosts") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } + var pathParam1 string - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - queryValues := queryURL.Query() - - if params.Active != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "active", runtime.ParamLocationQuery, *params.Active); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Bastion != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bastion", runtime.ParamLocationQuery, *params.Bastion); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Pagination != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, provisionerNameOrID) if err != nil { return nil, err } - if params.XRequestId != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) - if err != nil { - return nil, err - } - - req.Header.Set("X-Request-Id", headerParam0) - } - - if params.Accept != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", headerParam1) - } - - return req, nil -} - -// NewGetSshHostRequest generates requests for GetSshHost -func NewGetSshHostRequest(server string, hostID HostID, params *GetSshHostParams) (*http.Request, error) { - var err error - - var pathParam0 string + var pathParam2 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "hostID", runtime.ParamLocationPath, hostID) + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "webhookNameOrID", runtime.ParamLocationPath, webhookNameOrID) if err != nil { return nil, err } @@ -3472,7 +3980,7 @@ func NewGetSshHostRequest(server string, hostID HostID, params *GetSshHostParams return nil, err } - operationPath := fmt.Sprintf("/hosts/%s", pathParam0) + operationPath := fmt.Sprintf("/authorities/%s/provisioners/%s/webhooks/%s", pathParam0, pathParam1, pathParam2) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3512,24 +4020,24 @@ func NewGetSshHostRequest(server string, hostID HostID, params *GetSshHostParams return req, nil } -// NewPostHostsHostIDTagsRequest calls the generic PostHostsHostIDTags builder with application/json body -func NewPostHostsHostIDTagsRequest(server string, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody) (*http.Request, error) { +// NewPostAuthorityRootRequest calls the generic PostAuthorityRoot builder with application/json body +func NewPostAuthorityRootRequest(server string, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPostHostsHostIDTagsRequestWithBody(server, hostID, params, "application/json", bodyReader) + return NewPostAuthorityRootRequestWithBody(server, authorityID, params, "application/json", bodyReader) } -// NewPostHostsHostIDTagsRequestWithBody generates requests for PostHostsHostIDTags with any type of body -func NewPostHostsHostIDTagsRequestWithBody(server string, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostAuthorityRootRequestWithBody generates requests for PostAuthorityRoot with any type of body +func NewPostAuthorityRootRequestWithBody(server string, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "hostID", runtime.ParamLocationPath, hostID) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, authorityID) if err != nil { return nil, err } @@ -3539,7 +4047,7 @@ func NewPostHostsHostIDTagsRequestWithBody(server string, hostID HostID, params return nil, err } - operationPath := fmt.Sprintf("/hosts/%s/tags", pathParam0) + operationPath := fmt.Sprintf("/authorities/%s/root", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3581,64 +4089,8 @@ func NewPostHostsHostIDTagsRequestWithBody(server string, hostID HostID, params return req, nil } -// NewUnregisterSshHostRequest generates requests for UnregisterSshHost -func NewUnregisterSshHostRequest(server string, hostID HostID, params *UnregisterSshHostParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "hostID", runtime.ParamLocationPath, hostID) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/hosts/%s/unregister", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { - return nil, err - } - - if params.XRequestId != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) - if err != nil { - return nil, err - } - - req.Header.Set("X-Request-Id", headerParam0) - } - - if params.Accept != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", headerParam1) - } - - return req, nil -} - -// NewListInventoriesRequest generates requests for ListInventories -func NewListInventoriesRequest(server string, params *ListInventoriesParams) (*http.Request, error) { +// NewListCollectionsRequest generates requests for ListCollections +func NewListCollectionsRequest(server string, params *ListCollectionsParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -3646,7 +4098,7 @@ func NewListInventoriesRequest(server string, params *ListInventoriesParams) (*h return nil, err } - operationPath := fmt.Sprintf("/inventories") + operationPath := fmt.Sprintf("/collections") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3706,19 +4158,19 @@ func NewListInventoriesRequest(server string, params *ListInventoriesParams) (*h return req, nil } -// NewPostInventoriesRequest calls the generic PostInventories builder with application/json body -func NewPostInventoriesRequest(server string, params *PostInventoriesParams, body PostInventoriesJSONRequestBody) (*http.Request, error) { +// NewPostCollectionsRequest calls the generic PostCollections builder with application/json body +func NewPostCollectionsRequest(server string, params *PostCollectionsParams, body PostCollectionsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPostInventoriesRequestWithBody(server, params, "application/json", bodyReader) + return NewPostCollectionsRequestWithBody(server, params, "application/json", bodyReader) } -// NewPostInventoriesRequestWithBody generates requests for PostInventories with any type of body -func NewPostInventoriesRequestWithBody(server string, params *PostInventoriesParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostCollectionsRequestWithBody generates requests for PostCollections with any type of body +func NewPostCollectionsRequestWithBody(server string, params *PostCollectionsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -3726,7 +4178,7 @@ func NewPostInventoriesRequestWithBody(server string, params *PostInventoriesPar return nil, err } - operationPath := fmt.Sprintf("/inventories") + operationPath := fmt.Sprintf("/collections") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3768,13 +4220,13 @@ func NewPostInventoriesRequestWithBody(server string, params *PostInventoriesPar return req, nil } -// NewDeleteInventoryRequest generates requests for DeleteInventory -func NewDeleteInventoryRequest(server string, inventorySlug InventorySlug, params *DeleteInventoryParams) (*http.Request, error) { +// NewDeleteCollectionRequest generates requests for DeleteCollection +func NewDeleteCollectionRequest(server string, collectionSlug CollectionSlug, params *DeleteCollectionParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } @@ -3784,7 +4236,7 @@ func NewDeleteInventoryRequest(server string, inventorySlug InventorySlug, param return nil, err } - operationPath := fmt.Sprintf("/inventories/%s", pathParam0) + operationPath := fmt.Sprintf("/collections/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3824,69 +4276,13 @@ func NewDeleteInventoryRequest(server string, inventorySlug InventorySlug, param return req, nil } -// NewGetInventoryRequest generates requests for GetInventory -func NewGetInventoryRequest(server string, inventorySlug InventorySlug, params *GetInventoryParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/inventories/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - if params.XRequestId != nil { - var headerParam0 string - - headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) - if err != nil { - return nil, err - } - - req.Header.Set("X-Request-Id", headerParam0) - } - - if params.Accept != nil { - var headerParam1 string - - headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) - if err != nil { - return nil, err - } - - req.Header.Set("Accept", headerParam1) - } - - return req, nil -} - -// NewListInventoryItemsRequest generates requests for ListInventoryItems -func NewListInventoryItemsRequest(server string, inventorySlug InventorySlug, params *ListInventoryItemsParams) (*http.Request, error) { +// NewGetCollectionRequest generates requests for GetCollection +func NewGetCollectionRequest(server string, collectionSlug CollectionSlug, params *GetCollectionParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } @@ -3896,7 +4292,7 @@ func NewListInventoryItemsRequest(server string, inventorySlug InventorySlug, pa return nil, err } - operationPath := fmt.Sprintf("/inventories/%s/items", pathParam0) + operationPath := fmt.Sprintf("/collections/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -3906,26 +4302,6 @@ func NewListInventoryItemsRequest(server string, inventorySlug InventorySlug, pa return nil, err } - queryValues := queryURL.Query() - - if params.Pagination != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -3956,20 +4332,20 @@ func NewListInventoryItemsRequest(server string, inventorySlug InventorySlug, pa return req, nil } -// NewDeleteInventoryItemRequest generates requests for DeleteInventoryItem -func NewDeleteInventoryItemRequest(server string, inventorySlug InventorySlug, itemID ItemID, params *DeleteInventoryItemParams) (*http.Request, error) { +// NewDeleteCollectionInstanceRequest generates requests for DeleteCollectionInstance +func NewDeleteCollectionInstanceRequest(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *DeleteCollectionInstanceParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "itemID", runtime.ParamLocationPath, itemID) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, instanceID) if err != nil { return nil, err } @@ -3979,7 +4355,7 @@ func NewDeleteInventoryItemRequest(server string, inventorySlug InventorySlug, i return nil, err } - operationPath := fmt.Sprintf("/inventories/%s/items/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/collections/%s/instances/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4019,20 +4395,20 @@ func NewDeleteInventoryItemRequest(server string, inventorySlug InventorySlug, i return req, nil } -// NewGetInventoryItemRequest generates requests for GetInventoryItem -func NewGetInventoryItemRequest(server string, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemParams) (*http.Request, error) { +// NewGetCollectionInstanceRequest generates requests for GetCollectionInstance +func NewGetCollectionInstanceRequest(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "itemID", runtime.ParamLocationPath, itemID) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, instanceID) if err != nil { return nil, err } @@ -4042,7 +4418,7 @@ func NewGetInventoryItemRequest(server string, inventorySlug InventorySlug, item return nil, err } - operationPath := fmt.Sprintf("/inventories/%s/items/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/collections/%s/instances/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4082,31 +4458,31 @@ func NewGetInventoryItemRequest(server string, inventorySlug InventorySlug, item return req, nil } -// NewPutInventoryItemRequest calls the generic PutInventoryItem builder with application/json body -func NewPutInventoryItemRequest(server string, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, body PutInventoryItemJSONRequestBody) (*http.Request, error) { +// NewPutCollectionInstanceRequest calls the generic PutCollectionInstance builder with application/json body +func NewPutCollectionInstanceRequest(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, body PutCollectionInstanceJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPutInventoryItemRequestWithBody(server, inventorySlug, itemID, params, "application/json", bodyReader) + return NewPutCollectionInstanceRequestWithBody(server, collectionSlug, instanceID, params, "application/json", bodyReader) } -// NewPutInventoryItemRequestWithBody generates requests for PutInventoryItem with any type of body -func NewPutInventoryItemRequestWithBody(server string, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPutCollectionInstanceRequestWithBody generates requests for PutCollectionInstance with any type of body +func NewPutCollectionInstanceRequestWithBody(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "itemID", runtime.ParamLocationPath, itemID) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, instanceID) if err != nil { return nil, err } @@ -4116,7 +4492,7 @@ func NewPutInventoryItemRequestWithBody(server string, inventorySlug InventorySl return nil, err } - operationPath := fmt.Sprintf("/inventories/%s/items/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/collections/%s/instances/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4158,20 +4534,20 @@ func NewPutInventoryItemRequestWithBody(server string, inventorySlug InventorySl return req, nil } -// NewGetInventoryItemDataRequest generates requests for GetInventoryItemData -func NewGetInventoryItemDataRequest(server string, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemDataParams) (*http.Request, error) { +// NewGetCollectionInstanceDataRequest generates requests for GetCollectionInstanceData +func NewGetCollectionInstanceDataRequest(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceDataParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "itemID", runtime.ParamLocationPath, itemID) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, instanceID) if err != nil { return nil, err } @@ -4181,7 +4557,7 @@ func NewGetInventoryItemDataRequest(server string, inventorySlug InventorySlug, return nil, err } - operationPath := fmt.Sprintf("/inventories/%s/items/%s/data", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/collections/%s/instances/%s/data", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4221,31 +4597,31 @@ func NewGetInventoryItemDataRequest(server string, inventorySlug InventorySlug, return req, nil } -// NewPutInventoryItemDataRequest calls the generic PutInventoryItemData builder with application/json body -func NewPutInventoryItemDataRequest(server string, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, body PutInventoryItemDataJSONRequestBody) (*http.Request, error) { +// NewPutCollectionInstanceDataRequest calls the generic PutCollectionInstanceData builder with application/json body +func NewPutCollectionInstanceDataRequest(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, body PutCollectionInstanceDataJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewPutInventoryItemDataRequestWithBody(server, inventorySlug, itemID, params, "application/json", bodyReader) + return NewPutCollectionInstanceDataRequestWithBody(server, collectionSlug, instanceID, params, "application/json", bodyReader) } -// NewPutInventoryItemDataRequestWithBody generates requests for PutInventoryItemData with any type of body -func NewPutInventoryItemDataRequestWithBody(server string, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPutCollectionInstanceDataRequestWithBody generates requests for PutCollectionInstanceData with any type of body +func NewPutCollectionInstanceDataRequestWithBody(server string, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, inventorySlug) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) if err != nil { return nil, err } var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "itemID", runtime.ParamLocationPath, itemID) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, instanceID) if err != nil { return nil, err } @@ -4255,7 +4631,7 @@ func NewPutInventoryItemDataRequestWithBody(server string, inventorySlug Invento return nil, err } - operationPath := fmt.Sprintf("/inventories/%s/items/%s/data", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/collections/%s/instances/%s/data", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4297,16 +4673,23 @@ func NewPutInventoryItemDataRequestWithBody(server string, inventorySlug Invento return req, nil } -// NewGetSshHostTagsRequest generates requests for GetSshHostTags -func NewGetSshHostTagsRequest(server string, params *GetSshHostTagsParams) (*http.Request, error) { +// NewListCollectionInstancesRequest generates requests for ListCollectionInstances +func NewListCollectionInstancesRequest(server string, collectionSlug CollectionSlug, params *ListCollectionInstancesParams) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, collectionSlug) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/tags") + operationPath := fmt.Sprintf("/collections/%s/items", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4366,8 +4749,19 @@ func NewGetSshHostTagsRequest(server string, params *GetSshHostTagsParams) (*htt return req, nil } -// NewGetSshUsersRequest generates requests for GetSshUsers -func NewGetSshUsersRequest(server string, params *GetSshUsersParams) (*http.Request, error) { +// NewPostEndpointConfigurationsRequest calls the generic PostEndpointConfigurations builder with application/json body +func NewPostEndpointConfigurationsRequest(server string, params *PostEndpointConfigurationsParams, body PostEndpointConfigurationsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostEndpointConfigurationsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostEndpointConfigurationsRequestWithBody generates requests for PostEndpointConfigurations with any type of body +func NewPostEndpointConfigurationsRequestWithBody(server string, params *PostEndpointConfigurationsParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -4375,7 +4769,7 @@ func NewGetSshUsersRequest(server string, params *GetSshUsersParams) (*http.Requ return nil, err } - operationPath := fmt.Sprintf("/users") + operationPath := fmt.Sprintf("/endpoint-configurations") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4385,31 +4779,13 @@ func NewGetSshUsersRequest(server string, params *GetSshUsersParams) (*http.Requ return nil, err } - queryValues := queryURL.Query() - - if params.Pagination != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + if params.XRequestId != nil { var headerParam0 string @@ -4435,378 +4811,1976 @@ func NewGetSshUsersRequest(server string, params *GetSshUsersParams) (*http.Requ return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} +// NewDeleteEndpointConfigurationRequest generates requests for DeleteEndpointConfiguration +func NewDeleteEndpointConfigurationRequest(server string, endpointConfigurationID EndpointConfigurationID, params *DeleteEndpointConfigurationParams) (*http.Request, error) { + var err error -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} + var pathParam0 string -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "endpointConfigurationID", runtime.ParamLocationPath, endpointConfigurationID) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // GetAttestationAuthorities request - GetAttestationAuthoritiesWithResponse(ctx context.Context, params *GetAttestationAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthoritiesResponse, error) - // PostAttestationAuthorities request with any body - PostAttestationAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) + operationPath := fmt.Sprintf("/endpoint-configurations/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - PostAttestationAuthoritiesWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, body PostAttestationAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // DeleteAttestationAuthority request - DeleteAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *DeleteAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAttestationAuthorityResponse, error) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } - // GetAttestationAuthority request - GetAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *GetAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthorityResponse, error) + if params.XRequestId != nil { + var headerParam0 string - // PostAuth request with any body - PostAuthWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } - PostAuthWithResponse(ctx context.Context, body PostAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) + req.Header.Set("X-Request-Id", headerParam0) + } - // GetAuthorities request - GetAuthoritiesWithResponse(ctx context.Context, params *GetAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAuthoritiesResponse, error) + if params.Accept != nil { + var headerParam1 string - // PostAuthorities request with any body - PostAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } - PostAuthoritiesWithResponse(ctx context.Context, params *PostAuthoritiesParams, body PostAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) + req.Header.Set("Accept", headerParam1) + } - // PostAuthoritiesCsr request with any body - PostAuthoritiesCsrWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) + return req, nil +} - PostAuthoritiesCsrWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, body PostAuthoritiesCsrJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) +// NewGetEndpointConfigurationRequest generates requests for GetEndpointConfiguration +func NewGetEndpointConfigurationRequest(server string, endpointConfigurationID EndpointConfigurationID, params *GetEndpointConfigurationParams) (*http.Request, error) { + var err error - // DeleteAuthority request - DeleteAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *DeleteAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAuthorityResponse, error) + var pathParam0 string - // GetAuthority request - GetAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *GetAuthorityParams, reqEditors ...RequestEditorFn) (*GetAuthorityResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "endpointConfigurationID", runtime.ParamLocationPath, endpointConfigurationID) + if err != nil { + return nil, err + } - // ListAuthorityProvisioners request - ListAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *ListAuthorityProvisionersParams, reqEditors ...RequestEditorFn) (*ListAuthorityProvisionersResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // PostAuthorityProvisioners request with any body - PostAuthorityProvisionersWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) + operationPath := fmt.Sprintf("/endpoint-configurations/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - PostAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, body PostAuthorityProvisionersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // DeleteProvisioner request - DeleteProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *DeleteProvisionerParams, reqEditors ...RequestEditorFn) (*DeleteProvisionerResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // GetProvisioner request - GetProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams, reqEditors ...RequestEditorFn) (*GetProvisionerResponse, error) + if params.XRequestId != nil { + var headerParam0 string - // PostAuthorityRoot request with any body - PostAuthorityRootWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } - PostAuthorityRootWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) + req.Header.Set("X-Request-Id", headerParam0) + } - // GetSshGrants request - GetSshGrantsWithResponse(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*GetSshGrantsResponse, error) + if params.Accept != nil { + var headerParam1 string - // PostSshGrants request with any body - PostSshGrantsWithBodyWithResponse(ctx context.Context, params *PostSshGrantsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } - PostSshGrantsWithResponse(ctx context.Context, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) + req.Header.Set("Accept", headerParam1) + } - // DeleteSshGrant request - DeleteSshGrantWithResponse(ctx context.Context, grantID GrantID, params *DeleteSshGrantParams, reqEditors ...RequestEditorFn) (*DeleteSshGrantResponse, error) + return req, nil +} - // GetSshGrant request - GetSshGrantWithResponse(ctx context.Context, grantID GrantID, params *GetSshGrantParams, reqEditors ...RequestEditorFn) (*GetSshGrantResponse, error) +// NewGetSshGrantsRequest generates requests for GetSshGrants +func NewGetSshGrantsRequest(server string, params *GetSshGrantsParams) (*http.Request, error) { + var err error - // GetSshGroups request - GetSshGroupsWithResponse(ctx context.Context, params *GetSshGroupsParams, reqEditors ...RequestEditorFn) (*GetSshGroupsResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetSshGroup request - GetSshGroupWithResponse(ctx context.Context, groupID GroupID, params *GetSshGroupParams, reqEditors ...RequestEditorFn) (*GetSshGroupResponse, error) + operationPath := fmt.Sprintf("/grants") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // GetSshHosts request - GetSshHostsWithResponse(ctx context.Context, params *GetSshHostsParams, reqEditors ...RequestEditorFn) (*GetSshHostsResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // GetSshHost request - GetSshHostWithResponse(ctx context.Context, hostID HostID, params *GetSshHostParams, reqEditors ...RequestEditorFn) (*GetSshHostResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // PostHostsHostIDTags request with any body - PostHostsHostIDTagsWithBodyWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) + if params.XRequestId != nil { + var headerParam0 string - PostHostsHostIDTagsWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } - // UnregisterSshHost request - UnregisterSshHostWithResponse(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*UnregisterSshHostResponse, error) + req.Header.Set("X-Request-Id", headerParam0) + } - // ListInventories request - ListInventoriesWithResponse(ctx context.Context, params *ListInventoriesParams, reqEditors ...RequestEditorFn) (*ListInventoriesResponse, error) + if params.Accept != nil { + var headerParam1 string - // PostInventories request with any body - PostInventoriesWithBodyWithResponse(ctx context.Context, params *PostInventoriesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInventoriesResponse, error) + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } - PostInventoriesWithResponse(ctx context.Context, params *PostInventoriesParams, body PostInventoriesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInventoriesResponse, error) + req.Header.Set("Accept", headerParam1) + } - // DeleteInventory request - DeleteInventoryWithResponse(ctx context.Context, inventorySlug InventorySlug, params *DeleteInventoryParams, reqEditors ...RequestEditorFn) (*DeleteInventoryResponse, error) + return req, nil +} - // GetInventory request - GetInventoryWithResponse(ctx context.Context, inventorySlug InventorySlug, params *GetInventoryParams, reqEditors ...RequestEditorFn) (*GetInventoryResponse, error) +// NewPostSshGrantsRequest calls the generic PostSshGrants builder with application/json body +func NewPostSshGrantsRequest(server string, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostSshGrantsRequestWithBody(server, params, "application/json", bodyReader) +} - // ListInventoryItems request - ListInventoryItemsWithResponse(ctx context.Context, inventorySlug InventorySlug, params *ListInventoryItemsParams, reqEditors ...RequestEditorFn) (*ListInventoryItemsResponse, error) +// NewPostSshGrantsRequestWithBody generates requests for PostSshGrants with any type of body +func NewPostSshGrantsRequestWithBody(server string, params *PostSshGrantsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error - // DeleteInventoryItem request - DeleteInventoryItemWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *DeleteInventoryItemParams, reqEditors ...RequestEditorFn) (*DeleteInventoryItemResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetInventoryItem request - GetInventoryItemWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemParams, reqEditors ...RequestEditorFn) (*GetInventoryItemResponse, error) + operationPath := fmt.Sprintf("/grants") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // PutInventoryItem request with any body - PutInventoryItemWithBodyWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutInventoryItemResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - PutInventoryItemWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, body PutInventoryItemJSONRequestBody, reqEditors ...RequestEditorFn) (*PutInventoryItemResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - // GetInventoryItemData request - GetInventoryItemDataWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemDataParams, reqEditors ...RequestEditorFn) (*GetInventoryItemDataResponse, error) + req.Header.Add("Content-Type", contentType) - // PutInventoryItemData request with any body - PutInventoryItemDataWithBodyWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutInventoryItemDataResponse, error) + if params.XRequestId != nil { + var headerParam0 string - PutInventoryItemDataWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, body PutInventoryItemDataJSONRequestBody, reqEditors ...RequestEditorFn) (*PutInventoryItemDataResponse, error) + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } - // GetSshHostTags request - GetSshHostTagsWithResponse(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*GetSshHostTagsResponse, error) + req.Header.Set("X-Request-Id", headerParam0) + } - // GetSshUsers request - GetSshUsersWithResponse(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*GetSshUsersResponse, error) -} + if params.Accept != nil { + var headerParam1 string -type GetAttestationAuthoritiesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]AttestationAuthority - JSON400 *Error - JSON401 *Error - JSON500 *Error -} + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r GetAttestationAuthoritiesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + req.Header.Set("Accept", headerParam1) } - return http.StatusText(0) + + return req, nil } -// StatusCode returns HTTPResponse.StatusCode -func (r GetAttestationAuthoritiesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// NewDeleteSshGrantRequest generates requests for DeleteSshGrant +func NewDeleteSshGrantRequest(server string, grantID GrantID, params *DeleteSshGrantParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "grantID", runtime.ParamLocationPath, grantID) + if err != nil { + return nil, err } - return 0 -} -type PostAttestationAuthoritiesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *AttestationAuthority - JSON400 *Error - JSON401 *Error - JSON409 *Error - JSON412 *Error - JSON500 *Error -} + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r PostAttestationAuthoritiesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + operationPath := fmt.Sprintf("/grants/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r PostAttestationAuthoritiesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return 0 -} -type DeleteAttestationAuthorityResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON401 *Error - JSON500 *Error -} + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } -// Status returns HTTPResponse.Status -func (r DeleteAttestationAuthorityResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteAttestationAuthorityResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) } - return 0 -} -type GetAttestationAuthorityResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *AttestationAuthority - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *Error + return req, nil } -// Status returns HTTPResponse.Status -func (r GetAttestationAuthorityResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewGetSshGrantRequest generates requests for GetSshGrant +func NewGetSshGrantRequest(server string, grantID GrantID, params *GetSshGrantParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "grantID", runtime.ParamLocationPath, grantID) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetAttestationAuthorityResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return 0 -} -type PostAuthResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *struct { - Token *string `json:"token,omitempty"` + operationPath := fmt.Sprintf("/grants/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - JSON400 *Error - JSON401 *Error - JSON403 *Error - JSON500 *Error -} -// Status returns HTTPResponse.Status -func (r PostAuthResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r PostAuthResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err } - return 0 -} -type GetAuthoritiesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]Authority - JSON400 *Error - JSON401 *Error - JSON500 *Error -} + if params.XRequestId != nil { + var headerParam0 string -// Status returns HTTPResponse.Status -func (r GetAuthoritiesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r GetAuthoritiesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) } - return 0 -} -type PostAuthoritiesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Authority - JSON400 *Error - JSON401 *Error - JSON409 *Error - JSON412 *Error - JSON500 *Error + return req, nil } -// Status returns HTTPResponse.Status -func (r PostAuthoritiesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// NewGetSshGroupsRequest generates requests for GetSshGroups +func NewGetSshGroupsRequest(server string, params *GetSshGroupsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } - return http.StatusText(0) -} -// StatusCode returns HTTPResponse.StatusCode -func (r PostAuthoritiesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode + operationPath := fmt.Sprintf("/groups") + if operationPath[0] == '/' { + operationPath = "." + operationPath } - return 0 -} -type PostAuthoritiesCsrResponse struct { - Body []byte + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if params.Pagination != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetSshGroupRequest generates requests for GetSshGroup +func NewGetSshGroupRequest(server string, groupID GroupID, params *GetSshGroupParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "groupID", runtime.ParamLocationPath, groupID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/groups/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetSshHostsRequest generates requests for GetSshHosts +func NewGetSshHostsRequest(server string, params *GetSshHostsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/hosts") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if params.Active != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "active", runtime.ParamLocationQuery, *params.Active); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Bastion != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bastion", runtime.ParamLocationQuery, *params.Bastion); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Pagination != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetSshHostRequest generates requests for GetSshHost +func NewGetSshHostRequest(server string, hostID HostID, params *GetSshHostParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "hostID", runtime.ParamLocationPath, hostID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/hosts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewPostHostsHostIDTagsRequest calls the generic PostHostsHostIDTags builder with application/json body +func NewPostHostsHostIDTagsRequest(server string, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostHostsHostIDTagsRequestWithBody(server, hostID, params, "application/json", bodyReader) +} + +// NewPostHostsHostIDTagsRequestWithBody generates requests for PostHostsHostIDTags with any type of body +func NewPostHostsHostIDTagsRequestWithBody(server string, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "hostID", runtime.ParamLocationPath, hostID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/hosts/%s/tags", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewUnregisterSshHostRequest generates requests for UnregisterSshHost +func NewUnregisterSshHostRequest(server string, hostID HostID, params *UnregisterSshHostParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "hostID", runtime.ParamLocationPath, hostID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/hosts/%s/unregister", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewPostManagedConfigurationsRequest calls the generic PostManagedConfigurations builder with application/json body +func NewPostManagedConfigurationsRequest(server string, params *PostManagedConfigurationsParams, body PostManagedConfigurationsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewPostManagedConfigurationsRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewPostManagedConfigurationsRequestWithBody generates requests for PostManagedConfigurations with any type of body +func NewPostManagedConfigurationsRequestWithBody(server string, params *PostManagedConfigurationsParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/managed-configurations") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewDeleteManagedConfigurationHostIdRequest generates requests for DeleteManagedConfigurationHostId +func NewDeleteManagedConfigurationHostIdRequest(server string, managedConfigurationHostID ManagedConfigurationHostID, params *DeleteManagedConfigurationHostIdParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "managedConfigurationHostID", runtime.ParamLocationPath, managedConfigurationHostID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/managed-configurations/host/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetManagedConfigurationHostIdRequest generates requests for GetManagedConfigurationHostId +func NewGetManagedConfigurationHostIdRequest(server string, managedConfigurationHostID ManagedConfigurationHostID, params *GetManagedConfigurationHostIdParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "managedConfigurationHostID", runtime.ParamLocationPath, managedConfigurationHostID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/managed-configurations/host/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewDeleteManagedConfigurationRequest generates requests for DeleteManagedConfiguration +func NewDeleteManagedConfigurationRequest(server string, managedConfigurationID ManagedConfigurationID, params *DeleteManagedConfigurationParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "managedConfigurationID", runtime.ParamLocationPath, managedConfigurationID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/managed-configurations/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetManagedConfigurationRequest generates requests for GetManagedConfiguration +func NewGetManagedConfigurationRequest(server string, managedConfigurationID ManagedConfigurationID, params *GetManagedConfigurationParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "managedConfigurationID", runtime.ParamLocationPath, managedConfigurationID) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/managed-configurations/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetSshHostTagsRequest generates requests for GetSshHostTags +func NewGetSshHostTagsRequest(server string, params *GetSshHostTagsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/tags") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if params.Pagination != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +// NewGetSshUsersRequest generates requests for GetSshUsers +func NewGetSshUsersRequest(server string, params *GetSshUsersParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/users") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + queryValues := queryURL.Query() + + if params.Pagination != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("deepObject", true, "pagination", runtime.ParamLocationQuery, *params.Pagination); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + if params.XRequestId != nil { + var headerParam0 string + + headerParam0, err = runtime.StyleParamWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, *params.XRequestId) + if err != nil { + return nil, err + } + + req.Header.Set("X-Request-Id", headerParam0) + } + + if params.Accept != nil { + var headerParam1 string + + headerParam1, err = runtime.StyleParamWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, *params.Accept) + if err != nil { + return nil, err + } + + req.Header.Set("Accept", headerParam1) + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // PostAgentConfigurations request with any body + PostAgentConfigurationsWithBodyWithResponse(ctx context.Context, params *PostAgentConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAgentConfigurationsResponse, error) + + PostAgentConfigurationsWithResponse(ctx context.Context, params *PostAgentConfigurationsParams, body PostAgentConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAgentConfigurationsResponse, error) + + // DeleteAgentConfiguration request + DeleteAgentConfigurationWithResponse(ctx context.Context, agentConfigurationID AgentConfigurationID, params *DeleteAgentConfigurationParams, reqEditors ...RequestEditorFn) (*DeleteAgentConfigurationResponse, error) + + // GetAgentConfiguration request + GetAgentConfigurationWithResponse(ctx context.Context, agentConfigurationID AgentConfigurationID, params *GetAgentConfigurationParams, reqEditors ...RequestEditorFn) (*GetAgentConfigurationResponse, error) + + // GetAttestationAuthorities request + GetAttestationAuthoritiesWithResponse(ctx context.Context, params *GetAttestationAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthoritiesResponse, error) + + // PostAttestationAuthorities request with any body + PostAttestationAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) + + PostAttestationAuthoritiesWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, body PostAttestationAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) + + // DeleteAttestationAuthority request + DeleteAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *DeleteAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAttestationAuthorityResponse, error) + + // GetAttestationAuthority request + GetAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *GetAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthorityResponse, error) + + // PostAuth request with any body + PostAuthWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) + + PostAuthWithResponse(ctx context.Context, body PostAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) + + // GetAuthorities request + GetAuthoritiesWithResponse(ctx context.Context, params *GetAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAuthoritiesResponse, error) + + // PostAuthorities request with any body + PostAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) + + PostAuthoritiesWithResponse(ctx context.Context, params *PostAuthoritiesParams, body PostAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) + + // PostAuthoritiesCsr request with any body + PostAuthoritiesCsrWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) + + PostAuthoritiesCsrWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, body PostAuthoritiesCsrJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) + + // DeleteAuthority request + DeleteAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *DeleteAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAuthorityResponse, error) + + // GetAuthority request + GetAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *GetAuthorityParams, reqEditors ...RequestEditorFn) (*GetAuthorityResponse, error) + + // ListAuthorityProvisioners request + ListAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *ListAuthorityProvisionersParams, reqEditors ...RequestEditorFn) (*ListAuthorityProvisionersResponse, error) + + // PostAuthorityProvisioners request with any body + PostAuthorityProvisionersWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) + + PostAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, body PostAuthorityProvisionersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) + + // DeleteProvisioner request + DeleteProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *DeleteProvisionerParams, reqEditors ...RequestEditorFn) (*DeleteProvisionerResponse, error) + + // GetProvisioner request + GetProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams, reqEditors ...RequestEditorFn) (*GetProvisionerResponse, error) + + // PostWebhooks request with any body + PostWebhooksWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostWebhooksResponse, error) + + PostWebhooksWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, body PostWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*PostWebhooksResponse, error) + + // DeleteWebhook request + DeleteWebhookWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *DeleteWebhookParams, reqEditors ...RequestEditorFn) (*DeleteWebhookResponse, error) + + // GetWebhook request + GetWebhookWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *GetWebhookParams, reqEditors ...RequestEditorFn) (*GetWebhookResponse, error) + + // PostAuthorityRoot request with any body + PostAuthorityRootWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) + + PostAuthorityRootWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) + + // ListCollections request + ListCollectionsWithResponse(ctx context.Context, params *ListCollectionsParams, reqEditors ...RequestEditorFn) (*ListCollectionsResponse, error) + + // PostCollections request with any body + PostCollectionsWithBodyWithResponse(ctx context.Context, params *PostCollectionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCollectionsResponse, error) + + PostCollectionsWithResponse(ctx context.Context, params *PostCollectionsParams, body PostCollectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCollectionsResponse, error) + + // DeleteCollection request + DeleteCollectionWithResponse(ctx context.Context, collectionSlug CollectionSlug, params *DeleteCollectionParams, reqEditors ...RequestEditorFn) (*DeleteCollectionResponse, error) + + // GetCollection request + GetCollectionWithResponse(ctx context.Context, collectionSlug CollectionSlug, params *GetCollectionParams, reqEditors ...RequestEditorFn) (*GetCollectionResponse, error) + + // DeleteCollectionInstance request + DeleteCollectionInstanceWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *DeleteCollectionInstanceParams, reqEditors ...RequestEditorFn) (*DeleteCollectionInstanceResponse, error) + + // GetCollectionInstance request + GetCollectionInstanceWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceParams, reqEditors ...RequestEditorFn) (*GetCollectionInstanceResponse, error) + + // PutCollectionInstance request with any body + PutCollectionInstanceWithBodyWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCollectionInstanceResponse, error) + + PutCollectionInstanceWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, body PutCollectionInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCollectionInstanceResponse, error) + + // GetCollectionInstanceData request + GetCollectionInstanceDataWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceDataParams, reqEditors ...RequestEditorFn) (*GetCollectionInstanceDataResponse, error) + + // PutCollectionInstanceData request with any body + PutCollectionInstanceDataWithBodyWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCollectionInstanceDataResponse, error) + + PutCollectionInstanceDataWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, body PutCollectionInstanceDataJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCollectionInstanceDataResponse, error) + + // ListCollectionInstances request + ListCollectionInstancesWithResponse(ctx context.Context, collectionSlug CollectionSlug, params *ListCollectionInstancesParams, reqEditors ...RequestEditorFn) (*ListCollectionInstancesResponse, error) + + // PostEndpointConfigurations request with any body + PostEndpointConfigurationsWithBodyWithResponse(ctx context.Context, params *PostEndpointConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEndpointConfigurationsResponse, error) + + PostEndpointConfigurationsWithResponse(ctx context.Context, params *PostEndpointConfigurationsParams, body PostEndpointConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEndpointConfigurationsResponse, error) + + // DeleteEndpointConfiguration request + DeleteEndpointConfigurationWithResponse(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *DeleteEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*DeleteEndpointConfigurationResponse, error) + + // GetEndpointConfiguration request + GetEndpointConfigurationWithResponse(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *GetEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*GetEndpointConfigurationResponse, error) + + // GetSshGrants request + GetSshGrantsWithResponse(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*GetSshGrantsResponse, error) + + // PostSshGrants request with any body + PostSshGrantsWithBodyWithResponse(ctx context.Context, params *PostSshGrantsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) + + PostSshGrantsWithResponse(ctx context.Context, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) + + // DeleteSshGrant request + DeleteSshGrantWithResponse(ctx context.Context, grantID GrantID, params *DeleteSshGrantParams, reqEditors ...RequestEditorFn) (*DeleteSshGrantResponse, error) + + // GetSshGrant request + GetSshGrantWithResponse(ctx context.Context, grantID GrantID, params *GetSshGrantParams, reqEditors ...RequestEditorFn) (*GetSshGrantResponse, error) + + // GetSshGroups request + GetSshGroupsWithResponse(ctx context.Context, params *GetSshGroupsParams, reqEditors ...RequestEditorFn) (*GetSshGroupsResponse, error) + + // GetSshGroup request + GetSshGroupWithResponse(ctx context.Context, groupID GroupID, params *GetSshGroupParams, reqEditors ...RequestEditorFn) (*GetSshGroupResponse, error) + + // GetSshHosts request + GetSshHostsWithResponse(ctx context.Context, params *GetSshHostsParams, reqEditors ...RequestEditorFn) (*GetSshHostsResponse, error) + + // GetSshHost request + GetSshHostWithResponse(ctx context.Context, hostID HostID, params *GetSshHostParams, reqEditors ...RequestEditorFn) (*GetSshHostResponse, error) + + // PostHostsHostIDTags request with any body + PostHostsHostIDTagsWithBodyWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) + + PostHostsHostIDTagsWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) + + // UnregisterSshHost request + UnregisterSshHostWithResponse(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*UnregisterSshHostResponse, error) + + // PostManagedConfigurations request with any body + PostManagedConfigurationsWithBodyWithResponse(ctx context.Context, params *PostManagedConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostManagedConfigurationsResponse, error) + + PostManagedConfigurationsWithResponse(ctx context.Context, params *PostManagedConfigurationsParams, body PostManagedConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostManagedConfigurationsResponse, error) + + // DeleteManagedConfigurationHostId request + DeleteManagedConfigurationHostIdWithResponse(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *DeleteManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*DeleteManagedConfigurationHostIdResponse, error) + + // GetManagedConfigurationHostId request + GetManagedConfigurationHostIdWithResponse(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *GetManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*GetManagedConfigurationHostIdResponse, error) + + // DeleteManagedConfiguration request + DeleteManagedConfigurationWithResponse(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *DeleteManagedConfigurationParams, reqEditors ...RequestEditorFn) (*DeleteManagedConfigurationResponse, error) + + // GetManagedConfiguration request + GetManagedConfigurationWithResponse(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *GetManagedConfigurationParams, reqEditors ...RequestEditorFn) (*GetManagedConfigurationResponse, error) + + // GetSshHostTags request + GetSshHostTagsWithResponse(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*GetSshHostTagsResponse, error) + + // GetSshUsers request + GetSshUsersWithResponse(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*GetSshUsersResponse, error) +} + +type PostAgentConfigurationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AgentConfiguration + JSON400 *Error + JSON401 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAgentConfigurationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAgentConfigurationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteAgentConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteAgentConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteAgentConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetAgentConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AgentConfiguration + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetAgentConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAgentConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetAttestationAuthoritiesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]AttestationAuthority + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetAttestationAuthoritiesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAttestationAuthoritiesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostAttestationAuthoritiesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AttestationAuthority + JSON400 *Error + JSON401 *Error + JSON409 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAttestationAuthoritiesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAttestationAuthoritiesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteAttestationAuthorityResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteAttestationAuthorityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteAttestationAuthorityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetAttestationAuthorityResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *AttestationAuthority + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetAttestationAuthorityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAttestationAuthorityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostAuthResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *struct { + Token *string `json:"token,omitempty"` + } + JSON400 *Error + JSON401 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAuthResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAuthResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetAuthoritiesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Authority + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetAuthoritiesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAuthoritiesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostAuthoritiesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Authority + JSON400 *Error + JSON401 *Error + JSON409 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAuthoritiesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAuthoritiesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostAuthoritiesCsrResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *AuthorityCsr + JSON400 *Error + JSON401 *Error + JSON409 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAuthoritiesCsrResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAuthoritiesCsrResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteAuthorityResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteAuthorityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteAuthorityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetAuthorityResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Authority + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetAuthorityResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAuthorityResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListAuthorityProvisionersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Provisioner + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListAuthorityProvisionersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListAuthorityProvisionersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostAuthorityProvisionersResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Provisioner + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON409 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAuthorityProvisionersResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAuthorityProvisionersResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteProvisionerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteProvisionerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteProvisionerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetProvisionerResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Provisioner + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetProvisionerResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetProvisionerResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostWebhooksResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ProvisionerWebhook + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON409 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostWebhooksResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostWebhooksResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteWebhookResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteWebhookResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteWebhookResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetWebhookResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ProvisionerWebhook + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetWebhookResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetWebhookResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostAuthorityRootResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Authority + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostAuthorityRootResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostAuthorityRootResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListCollectionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]Collection + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListCollectionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListCollectionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostCollectionsResponse struct { + Body []byte HTTPResponse *http.Response - JSON201 *AuthorityCsr + JSON201 *Collection JSON400 *Error JSON401 *Error JSON409 *Error - JSON412 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r PostAuthoritiesCsrResponse) Status() string { +func (r PostCollectionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4814,23 +6788,22 @@ func (r PostAuthoritiesCsrResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PostAuthoritiesCsrResponse) StatusCode() int { +func (r PostCollectionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteAuthorityResponse struct { +type DeleteCollectionResponse struct { Body []byte HTTPResponse *http.Response JSON400 *Error - JSON401 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r DeleteAuthorityResponse) Status() string { +func (r DeleteCollectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4838,17 +6811,17 @@ func (r DeleteAuthorityResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteAuthorityResponse) StatusCode() int { +func (r DeleteCollectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetAuthorityResponse struct { +type GetCollectionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Authority + JSON200 *Collection JSON400 *Error JSON401 *Error JSON404 *Error @@ -4856,7 +6829,7 @@ type GetAuthorityResponse struct { } // Status returns HTTPResponse.Status -func (r GetAuthorityResponse) Status() string { +func (r GetCollectionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4864,17 +6837,41 @@ func (r GetAuthorityResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAuthorityResponse) StatusCode() int { +func (r GetCollectionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListAuthorityProvisionersResponse struct { +type DeleteCollectionInstanceResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]Provisioner + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteCollectionInstanceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteCollectionInstanceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetCollectionInstanceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *CollectionInstance JSON400 *Error JSON401 *Error JSON404 *Error @@ -4882,7 +6879,7 @@ type ListAuthorityProvisionersResponse struct { } // Status returns HTTPResponse.Status -func (r ListAuthorityProvisionersResponse) Status() string { +func (r GetCollectionInstanceResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4890,26 +6887,50 @@ func (r ListAuthorityProvisionersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListAuthorityProvisionersResponse) StatusCode() int { +func (r GetCollectionInstanceResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PostAuthorityProvisionersResponse struct { +type PutCollectionInstanceResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *Provisioner + JSON200 *CollectionInstance + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PutCollectionInstanceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PutCollectionInstanceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetCollectionInstanceDataResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *interface{} JSON400 *Error JSON401 *Error JSON404 *Error - JSON409 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r PostAuthorityProvisionersResponse) Status() string { +func (r GetCollectionInstanceDataResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4917,23 +6938,24 @@ func (r PostAuthorityProvisionersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PostAuthorityProvisionersResponse) StatusCode() int { +func (r GetCollectionInstanceDataResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteProvisionerResponse struct { +type PutCollectionInstanceDataResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *interface{} JSON400 *Error JSON401 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r DeleteProvisionerResponse) Status() string { +func (r PutCollectionInstanceDataResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4941,17 +6963,17 @@ func (r DeleteProvisionerResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteProvisionerResponse) StatusCode() int { +func (r PutCollectionInstanceDataResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetProvisionerResponse struct { +type ListCollectionInstancesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Provisioner + JSON200 *[]CollectionInstance JSON400 *Error JSON401 *Error JSON404 *Error @@ -4959,7 +6981,7 @@ type GetProvisionerResponse struct { } // Status returns HTTPResponse.Status -func (r GetProvisionerResponse) Status() string { +func (r ListCollectionInstancesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4967,17 +6989,66 @@ func (r GetProvisionerResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetProvisionerResponse) StatusCode() int { +func (r ListCollectionInstancesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PostAuthorityRootResponse struct { +type PostEndpointConfigurationsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Authority + JSON201 *EndpointConfiguration + JSON400 *Error + JSON401 *Error + JSON412 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostEndpointConfigurationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostEndpointConfigurationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteEndpointConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteEndpointConfigurationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteEndpointConfigurationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEndpointConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EndpointConfiguration JSON400 *Error JSON401 *Error JSON404 *Error @@ -4985,7 +7056,7 @@ type PostAuthorityRootResponse struct { } // Status returns HTTPResponse.Status -func (r PostAuthorityRootResponse) Status() string { +func (r GetEndpointConfigurationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4993,7 +7064,7 @@ func (r PostAuthorityRootResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PostAuthorityRootResponse) StatusCode() int { +func (r GetEndpointConfigurationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -5186,7 +7257,155 @@ type GetSshHostResponse struct { } // Status returns HTTPResponse.Status -func (r GetSshHostResponse) Status() string { +func (r GetSshHostResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetSshHostResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostHostsHostIDTagsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Tag + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostHostsHostIDTagsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostHostsHostIDTagsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UnregisterSshHostResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Host + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r UnregisterSshHostResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UnregisterSshHostResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type PostManagedConfigurationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *ManagedConfiguration + JSON400 *Error + JSON401 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r PostManagedConfigurationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PostManagedConfigurationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteManagedConfigurationHostIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteManagedConfigurationHostIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteManagedConfigurationHostIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetManagedConfigurationHostIdResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ManagedConfiguration + JSON400 *Error + JSON401 *Error + JSON404 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r GetManagedConfigurationHostIdResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetManagedConfigurationHostIdResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteManagedConfigurationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON400 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r DeleteManagedConfigurationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5194,17 +7413,17 @@ func (r GetSshHostResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetSshHostResponse) StatusCode() int { +func (r DeleteManagedConfigurationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PostHostsHostIDTagsResponse struct { +type GetManagedConfigurationResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *Tag + JSON200 *ManagedConfiguration JSON400 *Error JSON401 *Error JSON404 *Error @@ -5212,7 +7431,7 @@ type PostHostsHostIDTagsResponse struct { } // Status returns HTTPResponse.Status -func (r PostHostsHostIDTagsResponse) Status() string { +func (r GetManagedConfigurationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5220,24 +7439,24 @@ func (r PostHostsHostIDTagsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PostHostsHostIDTagsResponse) StatusCode() int { +func (r GetManagedConfigurationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UnregisterSshHostResponse struct { +type GetSshHostTagsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Host + JSON200 *[]Tag JSON400 *Error JSON401 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r UnregisterSshHostResponse) Status() string { +func (r GetSshHostTagsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5245,24 +7464,24 @@ func (r UnregisterSshHostResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UnregisterSshHostResponse) StatusCode() int { +func (r GetSshHostTagsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListInventoriesResponse struct { +type GetSshUsersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *[]Inventory + JSON200 *[]User JSON400 *Error JSON401 *Error JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListInventoriesResponse) Status() string { +func (r GetSshUsersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5270,727 +7489,1270 @@ func (r ListInventoriesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListInventoriesResponse) StatusCode() int { +func (r GetSshUsersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PostInventoriesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Inventory - JSON400 *Error - JSON401 *Error - JSON409 *Error - JSON500 *Error +// PostAgentConfigurationsWithBodyWithResponse request with arbitrary body returning *PostAgentConfigurationsResponse +func (c *ClientWithResponses) PostAgentConfigurationsWithBodyWithResponse(ctx context.Context, params *PostAgentConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAgentConfigurationsResponse, error) { + rsp, err := c.PostAgentConfigurationsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAgentConfigurationsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r PostInventoriesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) PostAgentConfigurationsWithResponse(ctx context.Context, params *PostAgentConfigurationsParams, body PostAgentConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAgentConfigurationsResponse, error) { + rsp, err := c.PostAgentConfigurations(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAgentConfigurationsResponse(rsp) +} + +// DeleteAgentConfigurationWithResponse request returning *DeleteAgentConfigurationResponse +func (c *ClientWithResponses) DeleteAgentConfigurationWithResponse(ctx context.Context, agentConfigurationID AgentConfigurationID, params *DeleteAgentConfigurationParams, reqEditors ...RequestEditorFn) (*DeleteAgentConfigurationResponse, error) { + rsp, err := c.DeleteAgentConfiguration(ctx, agentConfigurationID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAgentConfigurationResponse(rsp) +} + +// GetAgentConfigurationWithResponse request returning *GetAgentConfigurationResponse +func (c *ClientWithResponses) GetAgentConfigurationWithResponse(ctx context.Context, agentConfigurationID AgentConfigurationID, params *GetAgentConfigurationParams, reqEditors ...RequestEditorFn) (*GetAgentConfigurationResponse, error) { + rsp, err := c.GetAgentConfiguration(ctx, agentConfigurationID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAgentConfigurationResponse(rsp) +} + +// GetAttestationAuthoritiesWithResponse request returning *GetAttestationAuthoritiesResponse +func (c *ClientWithResponses) GetAttestationAuthoritiesWithResponse(ctx context.Context, params *GetAttestationAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthoritiesResponse, error) { + rsp, err := c.GetAttestationAuthorities(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAttestationAuthoritiesResponse(rsp) +} + +// PostAttestationAuthoritiesWithBodyWithResponse request with arbitrary body returning *PostAttestationAuthoritiesResponse +func (c *ClientWithResponses) PostAttestationAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) { + rsp, err := c.PostAttestationAuthoritiesWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAttestationAuthoritiesResponse(rsp) +} + +func (c *ClientWithResponses) PostAttestationAuthoritiesWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, body PostAttestationAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) { + rsp, err := c.PostAttestationAuthorities(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAttestationAuthoritiesResponse(rsp) +} + +// DeleteAttestationAuthorityWithResponse request returning *DeleteAttestationAuthorityResponse +func (c *ClientWithResponses) DeleteAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *DeleteAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAttestationAuthorityResponse, error) { + rsp, err := c.DeleteAttestationAuthority(ctx, attestationAuthorityID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAttestationAuthorityResponse(rsp) +} + +// GetAttestationAuthorityWithResponse request returning *GetAttestationAuthorityResponse +func (c *ClientWithResponses) GetAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *GetAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthorityResponse, error) { + rsp, err := c.GetAttestationAuthority(ctx, attestationAuthorityID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAttestationAuthorityResponse(rsp) +} + +// PostAuthWithBodyWithResponse request with arbitrary body returning *PostAuthResponse +func (c *ClientWithResponses) PostAuthWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) { + rsp, err := c.PostAuthWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthResponse(rsp) +} + +func (c *ClientWithResponses) PostAuthWithResponse(ctx context.Context, body PostAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) { + rsp, err := c.PostAuth(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthResponse(rsp) +} + +// GetAuthoritiesWithResponse request returning *GetAuthoritiesResponse +func (c *ClientWithResponses) GetAuthoritiesWithResponse(ctx context.Context, params *GetAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAuthoritiesResponse, error) { + rsp, err := c.GetAuthorities(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAuthoritiesResponse(rsp) +} + +// PostAuthoritiesWithBodyWithResponse request with arbitrary body returning *PostAuthoritiesResponse +func (c *ClientWithResponses) PostAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) { + rsp, err := c.PostAuthoritiesWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthoritiesResponse(rsp) +} + +func (c *ClientWithResponses) PostAuthoritiesWithResponse(ctx context.Context, params *PostAuthoritiesParams, body PostAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) { + rsp, err := c.PostAuthorities(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthoritiesResponse(rsp) +} + +// PostAuthoritiesCsrWithBodyWithResponse request with arbitrary body returning *PostAuthoritiesCsrResponse +func (c *ClientWithResponses) PostAuthoritiesCsrWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) { + rsp, err := c.PostAuthoritiesCsrWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthoritiesCsrResponse(rsp) +} + +func (c *ClientWithResponses) PostAuthoritiesCsrWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, body PostAuthoritiesCsrJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) { + rsp, err := c.PostAuthoritiesCsr(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthoritiesCsrResponse(rsp) +} + +// DeleteAuthorityWithResponse request returning *DeleteAuthorityResponse +func (c *ClientWithResponses) DeleteAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *DeleteAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAuthorityResponse, error) { + rsp, err := c.DeleteAuthority(ctx, authorityID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAuthorityResponse(rsp) +} + +// GetAuthorityWithResponse request returning *GetAuthorityResponse +func (c *ClientWithResponses) GetAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *GetAuthorityParams, reqEditors ...RequestEditorFn) (*GetAuthorityResponse, error) { + rsp, err := c.GetAuthority(ctx, authorityID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAuthorityResponse(rsp) +} + +// ListAuthorityProvisionersWithResponse request returning *ListAuthorityProvisionersResponse +func (c *ClientWithResponses) ListAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *ListAuthorityProvisionersParams, reqEditors ...RequestEditorFn) (*ListAuthorityProvisionersResponse, error) { + rsp, err := c.ListAuthorityProvisioners(ctx, authorityID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAuthorityProvisionersResponse(rsp) +} + +// PostAuthorityProvisionersWithBodyWithResponse request with arbitrary body returning *PostAuthorityProvisionersResponse +func (c *ClientWithResponses) PostAuthorityProvisionersWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) { + rsp, err := c.PostAuthorityProvisionersWithBody(ctx, authorityID, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthorityProvisionersResponse(rsp) +} + +func (c *ClientWithResponses) PostAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, body PostAuthorityProvisionersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) { + rsp, err := c.PostAuthorityProvisioners(ctx, authorityID, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthorityProvisionersResponse(rsp) +} + +// DeleteProvisionerWithResponse request returning *DeleteProvisionerResponse +func (c *ClientWithResponses) DeleteProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *DeleteProvisionerParams, reqEditors ...RequestEditorFn) (*DeleteProvisionerResponse, error) { + rsp, err := c.DeleteProvisioner(ctx, authorityID, provisionerNameOrID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteProvisionerResponse(rsp) +} + +// GetProvisionerWithResponse request returning *GetProvisionerResponse +func (c *ClientWithResponses) GetProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams, reqEditors ...RequestEditorFn) (*GetProvisionerResponse, error) { + rsp, err := c.GetProvisioner(ctx, authorityID, provisionerNameOrID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetProvisionerResponse(rsp) +} + +// PostWebhooksWithBodyWithResponse request with arbitrary body returning *PostWebhooksResponse +func (c *ClientWithResponses) PostWebhooksWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostWebhooksResponse, error) { + rsp, err := c.PostWebhooksWithBody(ctx, authorityID, provisionerNameOrID, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostWebhooksResponse(rsp) +} + +func (c *ClientWithResponses) PostWebhooksWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *PostWebhooksParams, body PostWebhooksJSONRequestBody, reqEditors ...RequestEditorFn) (*PostWebhooksResponse, error) { + rsp, err := c.PostWebhooks(ctx, authorityID, provisionerNameOrID, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostWebhooksResponse(rsp) +} + +// DeleteWebhookWithResponse request returning *DeleteWebhookResponse +func (c *ClientWithResponses) DeleteWebhookWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *DeleteWebhookParams, reqEditors ...RequestEditorFn) (*DeleteWebhookResponse, error) { + rsp, err := c.DeleteWebhook(ctx, authorityID, provisionerNameOrID, webhookNameOrID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteWebhookResponse(rsp) +} + +// GetWebhookWithResponse request returning *GetWebhookResponse +func (c *ClientWithResponses) GetWebhookWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params *GetWebhookParams, reqEditors ...RequestEditorFn) (*GetWebhookResponse, error) { + rsp, err := c.GetWebhook(ctx, authorityID, provisionerNameOrID, webhookNameOrID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetWebhookResponse(rsp) +} + +// PostAuthorityRootWithBodyWithResponse request with arbitrary body returning *PostAuthorityRootResponse +func (c *ClientWithResponses) PostAuthorityRootWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) { + rsp, err := c.PostAuthorityRootWithBody(ctx, authorityID, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthorityRootResponse(rsp) +} + +func (c *ClientWithResponses) PostAuthorityRootWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) { + rsp, err := c.PostAuthorityRoot(ctx, authorityID, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostAuthorityRootResponse(rsp) +} + +// ListCollectionsWithResponse request returning *ListCollectionsResponse +func (c *ClientWithResponses) ListCollectionsWithResponse(ctx context.Context, params *ListCollectionsParams, reqEditors ...RequestEditorFn) (*ListCollectionsResponse, error) { + rsp, err := c.ListCollections(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListCollectionsResponse(rsp) +} + +// PostCollectionsWithBodyWithResponse request with arbitrary body returning *PostCollectionsResponse +func (c *ClientWithResponses) PostCollectionsWithBodyWithResponse(ctx context.Context, params *PostCollectionsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostCollectionsResponse, error) { + rsp, err := c.PostCollectionsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostCollectionsResponse(rsp) +} + +func (c *ClientWithResponses) PostCollectionsWithResponse(ctx context.Context, params *PostCollectionsParams, body PostCollectionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostCollectionsResponse, error) { + rsp, err := c.PostCollections(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePostCollectionsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r PostInventoriesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteCollectionWithResponse request returning *DeleteCollectionResponse +func (c *ClientWithResponses) DeleteCollectionWithResponse(ctx context.Context, collectionSlug CollectionSlug, params *DeleteCollectionParams, reqEditors ...RequestEditorFn) (*DeleteCollectionResponse, error) { + rsp, err := c.DeleteCollection(ctx, collectionSlug, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteCollectionResponse(rsp) } -type DeleteInventoryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON500 *Error +// GetCollectionWithResponse request returning *GetCollectionResponse +func (c *ClientWithResponses) GetCollectionWithResponse(ctx context.Context, collectionSlug CollectionSlug, params *GetCollectionParams, reqEditors ...RequestEditorFn) (*GetCollectionResponse, error) { + rsp, err := c.GetCollection(ctx, collectionSlug, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetCollectionResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteInventoryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DeleteCollectionInstanceWithResponse request returning *DeleteCollectionInstanceResponse +func (c *ClientWithResponses) DeleteCollectionInstanceWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *DeleteCollectionInstanceParams, reqEditors ...RequestEditorFn) (*DeleteCollectionInstanceResponse, error) { + rsp, err := c.DeleteCollectionInstance(ctx, collectionSlug, instanceID, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDeleteCollectionInstanceResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteInventoryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetCollectionInstanceWithResponse request returning *GetCollectionInstanceResponse +func (c *ClientWithResponses) GetCollectionInstanceWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceParams, reqEditors ...RequestEditorFn) (*GetCollectionInstanceResponse, error) { + rsp, err := c.GetCollectionInstance(ctx, collectionSlug, instanceID, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetCollectionInstanceResponse(rsp) } -type GetInventoryResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Inventory - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *Error +// PutCollectionInstanceWithBodyWithResponse request with arbitrary body returning *PutCollectionInstanceResponse +func (c *ClientWithResponses) PutCollectionInstanceWithBodyWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCollectionInstanceResponse, error) { + rsp, err := c.PutCollectionInstanceWithBody(ctx, collectionSlug, instanceID, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutCollectionInstanceResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetInventoryResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) PutCollectionInstanceWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceParams, body PutCollectionInstanceJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCollectionInstanceResponse, error) { + rsp, err := c.PutCollectionInstance(ctx, collectionSlug, instanceID, params, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePutCollectionInstanceResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetInventoryResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetCollectionInstanceDataWithResponse request returning *GetCollectionInstanceDataResponse +func (c *ClientWithResponses) GetCollectionInstanceDataWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *GetCollectionInstanceDataParams, reqEditors ...RequestEditorFn) (*GetCollectionInstanceDataResponse, error) { + rsp, err := c.GetCollectionInstanceData(ctx, collectionSlug, instanceID, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetCollectionInstanceDataResponse(rsp) } -type ListInventoryItemsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]InventoryItem - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *Error +// PutCollectionInstanceDataWithBodyWithResponse request with arbitrary body returning *PutCollectionInstanceDataResponse +func (c *ClientWithResponses) PutCollectionInstanceDataWithBodyWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutCollectionInstanceDataResponse, error) { + rsp, err := c.PutCollectionInstanceDataWithBody(ctx, collectionSlug, instanceID, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePutCollectionInstanceDataResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListInventoryItemsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) PutCollectionInstanceDataWithResponse(ctx context.Context, collectionSlug CollectionSlug, instanceID InstanceID, params *PutCollectionInstanceDataParams, body PutCollectionInstanceDataJSONRequestBody, reqEditors ...RequestEditorFn) (*PutCollectionInstanceDataResponse, error) { + rsp, err := c.PutCollectionInstanceData(ctx, collectionSlug, instanceID, params, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePutCollectionInstanceDataResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListInventoryItemsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ListCollectionInstancesWithResponse request returning *ListCollectionInstancesResponse +func (c *ClientWithResponses) ListCollectionInstancesWithResponse(ctx context.Context, collectionSlug CollectionSlug, params *ListCollectionInstancesParams, reqEditors ...RequestEditorFn) (*ListCollectionInstancesResponse, error) { + rsp, err := c.ListCollectionInstances(ctx, collectionSlug, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseListCollectionInstancesResponse(rsp) } -type DeleteInventoryItemResponse struct { - Body []byte - HTTPResponse *http.Response - JSON400 *Error - JSON401 *Error - JSON500 *Error +// PostEndpointConfigurationsWithBodyWithResponse request with arbitrary body returning *PostEndpointConfigurationsResponse +func (c *ClientWithResponses) PostEndpointConfigurationsWithBodyWithResponse(ctx context.Context, params *PostEndpointConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostEndpointConfigurationsResponse, error) { + rsp, err := c.PostEndpointConfigurationsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostEndpointConfigurationsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteInventoryItemResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) PostEndpointConfigurationsWithResponse(ctx context.Context, params *PostEndpointConfigurationsParams, body PostEndpointConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostEndpointConfigurationsResponse, error) { + rsp, err := c.PostEndpointConfigurations(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePostEndpointConfigurationsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteInventoryItemResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteEndpointConfigurationWithResponse request returning *DeleteEndpointConfigurationResponse +func (c *ClientWithResponses) DeleteEndpointConfigurationWithResponse(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *DeleteEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*DeleteEndpointConfigurationResponse, error) { + rsp, err := c.DeleteEndpointConfiguration(ctx, endpointConfigurationID, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteEndpointConfigurationResponse(rsp) } -type GetInventoryItemResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *InventoryItem - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *Error +// GetEndpointConfigurationWithResponse request returning *GetEndpointConfigurationResponse +func (c *ClientWithResponses) GetEndpointConfigurationWithResponse(ctx context.Context, endpointConfigurationID EndpointConfigurationID, params *GetEndpointConfigurationParams, reqEditors ...RequestEditorFn) (*GetEndpointConfigurationResponse, error) { + rsp, err := c.GetEndpointConfiguration(ctx, endpointConfigurationID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEndpointConfigurationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetInventoryItemResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetSshGrantsWithResponse request returning *GetSshGrantsResponse +func (c *ClientWithResponses) GetSshGrantsWithResponse(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*GetSshGrantsResponse, error) { + rsp, err := c.GetSshGrants(ctx, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetSshGrantsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetInventoryItemResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// PostSshGrantsWithBodyWithResponse request with arbitrary body returning *PostSshGrantsResponse +func (c *ClientWithResponses) PostSshGrantsWithBodyWithResponse(ctx context.Context, params *PostSshGrantsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) { + rsp, err := c.PostSshGrantsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParsePostSshGrantsResponse(rsp) } -type PutInventoryItemResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *InventoryItem - JSON400 *Error - JSON401 *Error - JSON500 *Error +func (c *ClientWithResponses) PostSshGrantsWithResponse(ctx context.Context, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) { + rsp, err := c.PostSshGrants(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParsePostSshGrantsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r PutInventoryItemResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DeleteSshGrantWithResponse request returning *DeleteSshGrantResponse +func (c *ClientWithResponses) DeleteSshGrantWithResponse(ctx context.Context, grantID GrantID, params *DeleteSshGrantParams, reqEditors ...RequestEditorFn) (*DeleteSshGrantResponse, error) { + rsp, err := c.DeleteSshGrant(ctx, grantID, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDeleteSshGrantResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r PutInventoryItemResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetSshGrantWithResponse request returning *GetSshGrantResponse +func (c *ClientWithResponses) GetSshGrantWithResponse(ctx context.Context, grantID GrantID, params *GetSshGrantParams, reqEditors ...RequestEditorFn) (*GetSshGrantResponse, error) { + rsp, err := c.GetSshGrant(ctx, grantID, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetSshGrantResponse(rsp) } -type GetInventoryItemDataResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON400 *Error - JSON401 *Error - JSON404 *Error - JSON500 *Error +// GetSshGroupsWithResponse request returning *GetSshGroupsResponse +func (c *ClientWithResponses) GetSshGroupsWithResponse(ctx context.Context, params *GetSshGroupsParams, reqEditors ...RequestEditorFn) (*GetSshGroupsResponse, error) { + rsp, err := c.GetSshGroups(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSshGroupsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetInventoryItemDataResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetSshGroupWithResponse request returning *GetSshGroupResponse +func (c *ClientWithResponses) GetSshGroupWithResponse(ctx context.Context, groupID GroupID, params *GetSshGroupParams, reqEditors ...RequestEditorFn) (*GetSshGroupResponse, error) { + rsp, err := c.GetSshGroup(ctx, groupID, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetSshGroupResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetInventoryItemDataResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetSshHostsWithResponse request returning *GetSshHostsResponse +func (c *ClientWithResponses) GetSshHostsWithResponse(ctx context.Context, params *GetSshHostsParams, reqEditors ...RequestEditorFn) (*GetSshHostsResponse, error) { + rsp, err := c.GetSshHosts(ctx, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetSshHostsResponse(rsp) } -type PutInventoryItemDataResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *interface{} - JSON400 *Error - JSON401 *Error - JSON500 *Error +// GetSshHostWithResponse request returning *GetSshHostResponse +func (c *ClientWithResponses) GetSshHostWithResponse(ctx context.Context, hostID HostID, params *GetSshHostParams, reqEditors ...RequestEditorFn) (*GetSshHostResponse, error) { + rsp, err := c.GetSshHost(ctx, hostID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetSshHostResponse(rsp) } -// Status returns HTTPResponse.Status -func (r PutInventoryItemDataResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// PostHostsHostIDTagsWithBodyWithResponse request with arbitrary body returning *PostHostsHostIDTagsResponse +func (c *ClientWithResponses) PostHostsHostIDTagsWithBodyWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) { + rsp, err := c.PostHostsHostIDTagsWithBody(ctx, hostID, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePostHostsHostIDTagsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r PutInventoryItemDataResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) PostHostsHostIDTagsWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) { + rsp, err := c.PostHostsHostIDTags(ctx, hostID, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParsePostHostsHostIDTagsResponse(rsp) } -type GetSshHostTagsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]Tag - JSON400 *Error - JSON401 *Error - JSON500 *Error +// UnregisterSshHostWithResponse request returning *UnregisterSshHostResponse +func (c *ClientWithResponses) UnregisterSshHostWithResponse(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*UnregisterSshHostResponse, error) { + rsp, err := c.UnregisterSshHost(ctx, hostID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseUnregisterSshHostResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetSshHostTagsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// PostManagedConfigurationsWithBodyWithResponse request with arbitrary body returning *PostManagedConfigurationsResponse +func (c *ClientWithResponses) PostManagedConfigurationsWithBodyWithResponse(ctx context.Context, params *PostManagedConfigurationsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostManagedConfigurationsResponse, error) { + rsp, err := c.PostManagedConfigurationsWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParsePostManagedConfigurationsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetSshHostTagsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) PostManagedConfigurationsWithResponse(ctx context.Context, params *PostManagedConfigurationsParams, body PostManagedConfigurationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostManagedConfigurationsResponse, error) { + rsp, err := c.PostManagedConfigurations(ctx, params, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParsePostManagedConfigurationsResponse(rsp) } -type GetSshUsersResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *[]User - JSON400 *Error - JSON401 *Error - JSON500 *Error +// DeleteManagedConfigurationHostIdWithResponse request returning *DeleteManagedConfigurationHostIdResponse +func (c *ClientWithResponses) DeleteManagedConfigurationHostIdWithResponse(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *DeleteManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*DeleteManagedConfigurationHostIdResponse, error) { + rsp, err := c.DeleteManagedConfigurationHostId(ctx, managedConfigurationHostID, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteManagedConfigurationHostIdResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetSshUsersResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetManagedConfigurationHostIdWithResponse request returning *GetManagedConfigurationHostIdResponse +func (c *ClientWithResponses) GetManagedConfigurationHostIdWithResponse(ctx context.Context, managedConfigurationHostID ManagedConfigurationHostID, params *GetManagedConfigurationHostIdParams, reqEditors ...RequestEditorFn) (*GetManagedConfigurationHostIdResponse, error) { + rsp, err := c.GetManagedConfigurationHostId(ctx, managedConfigurationHostID, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetManagedConfigurationHostIdResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetSshUsersResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteManagedConfigurationWithResponse request returning *DeleteManagedConfigurationResponse +func (c *ClientWithResponses) DeleteManagedConfigurationWithResponse(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *DeleteManagedConfigurationParams, reqEditors ...RequestEditorFn) (*DeleteManagedConfigurationResponse, error) { + rsp, err := c.DeleteManagedConfiguration(ctx, managedConfigurationID, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteManagedConfigurationResponse(rsp) } -// GetAttestationAuthoritiesWithResponse request returning *GetAttestationAuthoritiesResponse -func (c *ClientWithResponses) GetAttestationAuthoritiesWithResponse(ctx context.Context, params *GetAttestationAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthoritiesResponse, error) { - rsp, err := c.GetAttestationAuthorities(ctx, params, reqEditors...) +// GetManagedConfigurationWithResponse request returning *GetManagedConfigurationResponse +func (c *ClientWithResponses) GetManagedConfigurationWithResponse(ctx context.Context, managedConfigurationID ManagedConfigurationID, params *GetManagedConfigurationParams, reqEditors ...RequestEditorFn) (*GetManagedConfigurationResponse, error) { + rsp, err := c.GetManagedConfiguration(ctx, managedConfigurationID, params, reqEditors...) if err != nil { return nil, err } - return ParseGetAttestationAuthoritiesResponse(rsp) + return ParseGetManagedConfigurationResponse(rsp) } -// PostAttestationAuthoritiesWithBodyWithResponse request with arbitrary body returning *PostAttestationAuthoritiesResponse -func (c *ClientWithResponses) PostAttestationAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) { - rsp, err := c.PostAttestationAuthoritiesWithBody(ctx, params, contentType, body, reqEditors...) +// GetSshHostTagsWithResponse request returning *GetSshHostTagsResponse +func (c *ClientWithResponses) GetSshHostTagsWithResponse(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*GetSshHostTagsResponse, error) { + rsp, err := c.GetSshHostTags(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParsePostAttestationAuthoritiesResponse(rsp) + return ParseGetSshHostTagsResponse(rsp) } -func (c *ClientWithResponses) PostAttestationAuthoritiesWithResponse(ctx context.Context, params *PostAttestationAuthoritiesParams, body PostAttestationAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAttestationAuthoritiesResponse, error) { - rsp, err := c.PostAttestationAuthorities(ctx, params, body, reqEditors...) +// GetSshUsersWithResponse request returning *GetSshUsersResponse +func (c *ClientWithResponses) GetSshUsersWithResponse(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*GetSshUsersResponse, error) { + rsp, err := c.GetSshUsers(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParsePostAttestationAuthoritiesResponse(rsp) + return ParseGetSshUsersResponse(rsp) } -// DeleteAttestationAuthorityWithResponse request returning *DeleteAttestationAuthorityResponse -func (c *ClientWithResponses) DeleteAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *DeleteAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAttestationAuthorityResponse, error) { - rsp, err := c.DeleteAttestationAuthority(ctx, attestationAuthorityID, params, reqEditors...) +// ParsePostAgentConfigurationsResponse parses an HTTP response from a PostAgentConfigurationsWithResponse call +func ParsePostAgentConfigurationsResponse(rsp *http.Response) (*PostAgentConfigurationsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteAttestationAuthorityResponse(rsp) + + response := &PostAgentConfigurationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AgentConfiguration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// GetAttestationAuthorityWithResponse request returning *GetAttestationAuthorityResponse -func (c *ClientWithResponses) GetAttestationAuthorityWithResponse(ctx context.Context, attestationAuthorityID AttestationAuthorityID, params *GetAttestationAuthorityParams, reqEditors ...RequestEditorFn) (*GetAttestationAuthorityResponse, error) { - rsp, err := c.GetAttestationAuthority(ctx, attestationAuthorityID, params, reqEditors...) +// ParseDeleteAgentConfigurationResponse parses an HTTP response from a DeleteAgentConfigurationWithResponse call +func ParseDeleteAgentConfigurationResponse(rsp *http.Response) (*DeleteAgentConfigurationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetAttestationAuthorityResponse(rsp) + + response := &DeleteAgentConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// PostAuthWithBodyWithResponse request with arbitrary body returning *PostAuthResponse -func (c *ClientWithResponses) PostAuthWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) { - rsp, err := c.PostAuthWithBody(ctx, contentType, body, reqEditors...) +// ParseGetAgentConfigurationResponse parses an HTTP response from a GetAgentConfigurationWithResponse call +func ParseGetAgentConfigurationResponse(rsp *http.Response) (*GetAgentConfigurationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePostAuthResponse(rsp) + + response := &GetAgentConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AgentConfiguration + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) PostAuthWithResponse(ctx context.Context, body PostAuthJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthResponse, error) { - rsp, err := c.PostAuth(ctx, body, reqEditors...) +// ParseGetAttestationAuthoritiesResponse parses an HTTP response from a GetAttestationAuthoritiesWithResponse call +func ParseGetAttestationAuthoritiesResponse(rsp *http.Response) (*GetAttestationAuthoritiesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePostAuthResponse(rsp) + + response := &GetAttestationAuthoritiesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []AttestationAuthority + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// GetAuthoritiesWithResponse request returning *GetAuthoritiesResponse -func (c *ClientWithResponses) GetAuthoritiesWithResponse(ctx context.Context, params *GetAuthoritiesParams, reqEditors ...RequestEditorFn) (*GetAuthoritiesResponse, error) { - rsp, err := c.GetAuthorities(ctx, params, reqEditors...) - if err != nil { - return nil, err +// ParsePostAttestationAuthoritiesResponse parses an HTTP response from a PostAttestationAuthoritiesWithResponse call +func ParsePostAttestationAuthoritiesResponse(rsp *http.Response) (*PostAttestationAuthoritiesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PostAttestationAuthoritiesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AttestationAuthority + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseGetAuthoritiesResponse(rsp) -} -// PostAuthoritiesWithBodyWithResponse request with arbitrary body returning *PostAuthoritiesResponse -func (c *ClientWithResponses) PostAuthoritiesWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) { - rsp, err := c.PostAuthoritiesWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostAuthoritiesResponse(rsp) + return response, nil } -func (c *ClientWithResponses) PostAuthoritiesWithResponse(ctx context.Context, params *PostAuthoritiesParams, body PostAuthoritiesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesResponse, error) { - rsp, err := c.PostAuthorities(ctx, params, body, reqEditors...) +// ParseDeleteAttestationAuthorityResponse parses an HTTP response from a DeleteAttestationAuthorityWithResponse call +func ParseDeleteAttestationAuthorityResponse(rsp *http.Response) (*DeleteAttestationAuthorityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePostAuthoritiesResponse(rsp) -} -// PostAuthoritiesCsrWithBodyWithResponse request with arbitrary body returning *PostAuthoritiesCsrResponse -func (c *ClientWithResponses) PostAuthoritiesCsrWithBodyWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) { - rsp, err := c.PostAuthoritiesCsrWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &DeleteAttestationAuthorityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParsePostAuthoritiesCsrResponse(rsp) -} -func (c *ClientWithResponses) PostAuthoritiesCsrWithResponse(ctx context.Context, params *PostAuthoritiesCsrParams, body PostAuthoritiesCsrJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthoritiesCsrResponse, error) { - rsp, err := c.PostAuthoritiesCsr(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostAuthoritiesCsrResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// DeleteAuthorityWithResponse request returning *DeleteAuthorityResponse -func (c *ClientWithResponses) DeleteAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *DeleteAuthorityParams, reqEditors ...RequestEditorFn) (*DeleteAuthorityResponse, error) { - rsp, err := c.DeleteAuthority(ctx, authorityID, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteAuthorityResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// GetAuthorityWithResponse request returning *GetAuthorityResponse -func (c *ClientWithResponses) GetAuthorityWithResponse(ctx context.Context, authorityID AuthorityID, params *GetAuthorityParams, reqEditors ...RequestEditorFn) (*GetAuthorityResponse, error) { - rsp, err := c.GetAuthority(ctx, authorityID, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAuthorityResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// ListAuthorityProvisionersWithResponse request returning *ListAuthorityProvisionersResponse -func (c *ClientWithResponses) ListAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *ListAuthorityProvisionersParams, reqEditors ...RequestEditorFn) (*ListAuthorityProvisionersResponse, error) { - rsp, err := c.ListAuthorityProvisioners(ctx, authorityID, params, reqEditors...) - if err != nil { - return nil, err } - return ParseListAuthorityProvisionersResponse(rsp) -} -// PostAuthorityProvisionersWithBodyWithResponse request with arbitrary body returning *PostAuthorityProvisionersResponse -func (c *ClientWithResponses) PostAuthorityProvisionersWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) { - rsp, err := c.PostAuthorityProvisionersWithBody(ctx, authorityID, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostAuthorityProvisionersResponse(rsp) + return response, nil } -func (c *ClientWithResponses) PostAuthorityProvisionersWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityProvisionersParams, body PostAuthorityProvisionersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityProvisionersResponse, error) { - rsp, err := c.PostAuthorityProvisioners(ctx, authorityID, params, body, reqEditors...) +// ParseGetAttestationAuthorityResponse parses an HTTP response from a GetAttestationAuthorityWithResponse call +func ParseGetAttestationAuthorityResponse(rsp *http.Response) (*GetAttestationAuthorityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePostAuthorityProvisionersResponse(rsp) -} -// DeleteProvisionerWithResponse request returning *DeleteProvisionerResponse -func (c *ClientWithResponses) DeleteProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *DeleteProvisionerParams, reqEditors ...RequestEditorFn) (*DeleteProvisionerResponse, error) { - rsp, err := c.DeleteProvisioner(ctx, authorityID, provisionerNameOrID, params, reqEditors...) - if err != nil { - return nil, err + response := &GetAttestationAuthorityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseDeleteProvisionerResponse(rsp) -} -// GetProvisionerWithResponse request returning *GetProvisionerResponse -func (c *ClientWithResponses) GetProvisionerWithResponse(ctx context.Context, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params *GetProvisionerParams, reqEditors ...RequestEditorFn) (*GetProvisionerResponse, error) { - rsp, err := c.GetProvisioner(ctx, authorityID, provisionerNameOrID, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetProvisionerResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest AttestationAuthority + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// PostAuthorityRootWithBodyWithResponse request with arbitrary body returning *PostAuthorityRootResponse -func (c *ClientWithResponses) PostAuthorityRootWithBodyWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) { - rsp, err := c.PostAuthorityRootWithBody(ctx, authorityID, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostAuthorityRootResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -func (c *ClientWithResponses) PostAuthorityRootWithResponse(ctx context.Context, authorityID AuthorityID, params *PostAuthorityRootParams, body PostAuthorityRootJSONRequestBody, reqEditors ...RequestEditorFn) (*PostAuthorityRootResponse, error) { - rsp, err := c.PostAuthorityRoot(ctx, authorityID, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostAuthorityRootResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -// GetSshGrantsWithResponse request returning *GetSshGrantsResponse -func (c *ClientWithResponses) GetSshGrantsWithResponse(ctx context.Context, params *GetSshGrantsParams, reqEditors ...RequestEditorFn) (*GetSshGrantsResponse, error) { - rsp, err := c.GetSshGrants(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSshGrantsResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -// PostSshGrantsWithBodyWithResponse request with arbitrary body returning *PostSshGrantsResponse -func (c *ClientWithResponses) PostSshGrantsWithBodyWithResponse(ctx context.Context, params *PostSshGrantsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) { - rsp, err := c.PostSshGrantsWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePostSshGrantsResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -func (c *ClientWithResponses) PostSshGrantsWithResponse(ctx context.Context, params *PostSshGrantsParams, body PostSshGrantsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSshGrantsResponse, error) { - rsp, err := c.PostSshGrants(ctx, params, body, reqEditors...) - if err != nil { - return nil, err } - return ParsePostSshGrantsResponse(rsp) -} -// DeleteSshGrantWithResponse request returning *DeleteSshGrantResponse -func (c *ClientWithResponses) DeleteSshGrantWithResponse(ctx context.Context, grantID GrantID, params *DeleteSshGrantParams, reqEditors ...RequestEditorFn) (*DeleteSshGrantResponse, error) { - rsp, err := c.DeleteSshGrant(ctx, grantID, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteSshGrantResponse(rsp) + return response, nil } -// GetSshGrantWithResponse request returning *GetSshGrantResponse -func (c *ClientWithResponses) GetSshGrantWithResponse(ctx context.Context, grantID GrantID, params *GetSshGrantParams, reqEditors ...RequestEditorFn) (*GetSshGrantResponse, error) { - rsp, err := c.GetSshGrant(ctx, grantID, params, reqEditors...) +// ParsePostAuthResponse parses an HTTP response from a PostAuthWithResponse call +func ParsePostAuthResponse(rsp *http.Response) (*PostAuthResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetSshGrantResponse(rsp) -} -// GetSshGroupsWithResponse request returning *GetSshGroupsResponse -func (c *ClientWithResponses) GetSshGroupsWithResponse(ctx context.Context, params *GetSshGroupsParams, reqEditors ...RequestEditorFn) (*GetSshGroupsResponse, error) { - rsp, err := c.GetSshGroups(ctx, params, reqEditors...) - if err != nil { - return nil, err + response := &PostAuthResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetSshGroupsResponse(rsp) -} -// GetSshGroupWithResponse request returning *GetSshGroupResponse -func (c *ClientWithResponses) GetSshGroupWithResponse(ctx context.Context, groupID GroupID, params *GetSshGroupParams, reqEditors ...RequestEditorFn) (*GetSshGroupResponse, error) { - rsp, err := c.GetSshGroup(ctx, groupID, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSshGroupResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest struct { + Token *string `json:"token,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// GetSshHostsWithResponse request returning *GetSshHostsResponse -func (c *ClientWithResponses) GetSshHostsWithResponse(ctx context.Context, params *GetSshHostsParams, reqEditors ...RequestEditorFn) (*GetSshHostsResponse, error) { - rsp, err := c.GetSshHosts(ctx, params, reqEditors...) - if err != nil { - return nil, err } - return ParseGetSshHostsResponse(rsp) -} -// GetSshHostWithResponse request returning *GetSshHostResponse -func (c *ClientWithResponses) GetSshHostWithResponse(ctx context.Context, hostID HostID, params *GetSshHostParams, reqEditors ...RequestEditorFn) (*GetSshHostResponse, error) { - rsp, err := c.GetSshHost(ctx, hostID, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSshHostResponse(rsp) + return response, nil } -// PostHostsHostIDTagsWithBodyWithResponse request with arbitrary body returning *PostHostsHostIDTagsResponse -func (c *ClientWithResponses) PostHostsHostIDTagsWithBodyWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) { - rsp, err := c.PostHostsHostIDTagsWithBody(ctx, hostID, params, contentType, body, reqEditors...) +// ParseGetAuthoritiesResponse parses an HTTP response from a GetAuthoritiesWithResponse call +func ParseGetAuthoritiesResponse(rsp *http.Response) (*GetAuthoritiesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePostHostsHostIDTagsResponse(rsp) -} -func (c *ClientWithResponses) PostHostsHostIDTagsWithResponse(ctx context.Context, hostID HostID, params *PostHostsHostIDTagsParams, body PostHostsHostIDTagsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostHostsHostIDTagsResponse, error) { - rsp, err := c.PostHostsHostIDTags(ctx, hostID, params, body, reqEditors...) - if err != nil { - return nil, err + response := &GetAuthoritiesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParsePostHostsHostIDTagsResponse(rsp) -} -// UnregisterSshHostWithResponse request returning *UnregisterSshHostResponse -func (c *ClientWithResponses) UnregisterSshHostWithResponse(ctx context.Context, hostID HostID, params *UnregisterSshHostParams, reqEditors ...RequestEditorFn) (*UnregisterSshHostResponse, error) { - rsp, err := c.UnregisterSshHost(ctx, hostID, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Authority + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseUnregisterSshHostResponse(rsp) + + return response, nil } -// ListInventoriesWithResponse request returning *ListInventoriesResponse -func (c *ClientWithResponses) ListInventoriesWithResponse(ctx context.Context, params *ListInventoriesParams, reqEditors ...RequestEditorFn) (*ListInventoriesResponse, error) { - rsp, err := c.ListInventories(ctx, params, reqEditors...) +// ParsePostAuthoritiesResponse parses an HTTP response from a PostAuthoritiesWithResponse call +func ParsePostAuthoritiesResponse(rsp *http.Response) (*PostAuthoritiesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListInventoriesResponse(rsp) -} -// PostInventoriesWithBodyWithResponse request with arbitrary body returning *PostInventoriesResponse -func (c *ClientWithResponses) PostInventoriesWithBodyWithResponse(ctx context.Context, params *PostInventoriesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInventoriesResponse, error) { - rsp, err := c.PostInventoriesWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &PostAuthoritiesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParsePostInventoriesResponse(rsp) -} -func (c *ClientWithResponses) PostInventoriesWithResponse(ctx context.Context, params *PostInventoriesParams, body PostInventoriesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInventoriesResponse, error) { - rsp, err := c.PostInventories(ctx, params, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Authority + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParsePostInventoriesResponse(rsp) + + return response, nil } -// DeleteInventoryWithResponse request returning *DeleteInventoryResponse -func (c *ClientWithResponses) DeleteInventoryWithResponse(ctx context.Context, inventorySlug InventorySlug, params *DeleteInventoryParams, reqEditors ...RequestEditorFn) (*DeleteInventoryResponse, error) { - rsp, err := c.DeleteInventory(ctx, inventorySlug, params, reqEditors...) +// ParsePostAuthoritiesCsrResponse parses an HTTP response from a PostAuthoritiesCsrWithResponse call +func ParsePostAuthoritiesCsrResponse(rsp *http.Response) (*PostAuthoritiesCsrResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteInventoryResponse(rsp) -} -// GetInventoryWithResponse request returning *GetInventoryResponse -func (c *ClientWithResponses) GetInventoryWithResponse(ctx context.Context, inventorySlug InventorySlug, params *GetInventoryParams, reqEditors ...RequestEditorFn) (*GetInventoryResponse, error) { - rsp, err := c.GetInventory(ctx, inventorySlug, params, reqEditors...) - if err != nil { - return nil, err + response := &PostAuthoritiesCsrResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetInventoryResponse(rsp) -} -// ListInventoryItemsWithResponse request returning *ListInventoryItemsResponse -func (c *ClientWithResponses) ListInventoryItemsWithResponse(ctx context.Context, inventorySlug InventorySlug, params *ListInventoryItemsParams, reqEditors ...RequestEditorFn) (*ListInventoryItemsResponse, error) { - rsp, err := c.ListInventoryItems(ctx, inventorySlug, params, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest AuthorityCsr + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseListInventoryItemsResponse(rsp) + + return response, nil } -// DeleteInventoryItemWithResponse request returning *DeleteInventoryItemResponse -func (c *ClientWithResponses) DeleteInventoryItemWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *DeleteInventoryItemParams, reqEditors ...RequestEditorFn) (*DeleteInventoryItemResponse, error) { - rsp, err := c.DeleteInventoryItem(ctx, inventorySlug, itemID, params, reqEditors...) +// ParseDeleteAuthorityResponse parses an HTTP response from a DeleteAuthorityWithResponse call +func ParseDeleteAuthorityResponse(rsp *http.Response) (*DeleteAuthorityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteInventoryItemResponse(rsp) -} -// GetInventoryItemWithResponse request returning *GetInventoryItemResponse -func (c *ClientWithResponses) GetInventoryItemWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemParams, reqEditors ...RequestEditorFn) (*GetInventoryItemResponse, error) { - rsp, err := c.GetInventoryItem(ctx, inventorySlug, itemID, params, reqEditors...) - if err != nil { - return nil, err + response := &DeleteAuthorityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetInventoryItemResponse(rsp) -} -// PutInventoryItemWithBodyWithResponse request with arbitrary body returning *PutInventoryItemResponse -func (c *ClientWithResponses) PutInventoryItemWithBodyWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutInventoryItemResponse, error) { - rsp, err := c.PutInventoryItemWithBody(ctx, inventorySlug, itemID, params, contentType, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParsePutInventoryItemResponse(rsp) + + return response, nil } -func (c *ClientWithResponses) PutInventoryItemWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemParams, body PutInventoryItemJSONRequestBody, reqEditors ...RequestEditorFn) (*PutInventoryItemResponse, error) { - rsp, err := c.PutInventoryItem(ctx, inventorySlug, itemID, params, body, reqEditors...) +// ParseGetAuthorityResponse parses an HTTP response from a GetAuthorityWithResponse call +func ParseGetAuthorityResponse(rsp *http.Response) (*GetAuthorityResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParsePutInventoryItemResponse(rsp) -} -// GetInventoryItemDataWithResponse request returning *GetInventoryItemDataResponse -func (c *ClientWithResponses) GetInventoryItemDataWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *GetInventoryItemDataParams, reqEditors ...RequestEditorFn) (*GetInventoryItemDataResponse, error) { - rsp, err := c.GetInventoryItemData(ctx, inventorySlug, itemID, params, reqEditors...) - if err != nil { - return nil, err + response := &GetAuthorityResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseGetInventoryItemDataResponse(rsp) -} -// PutInventoryItemDataWithBodyWithResponse request with arbitrary body returning *PutInventoryItemDataResponse -func (c *ClientWithResponses) PutInventoryItemDataWithBodyWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutInventoryItemDataResponse, error) { - rsp, err := c.PutInventoryItemDataWithBody(ctx, inventorySlug, itemID, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutInventoryItemDataResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Authority + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest -func (c *ClientWithResponses) PutInventoryItemDataWithResponse(ctx context.Context, inventorySlug InventorySlug, itemID ItemID, params *PutInventoryItemDataParams, body PutInventoryItemDataJSONRequestBody, reqEditors ...RequestEditorFn) (*PutInventoryItemDataResponse, error) { - rsp, err := c.PutInventoryItemData(ctx, inventorySlug, itemID, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParsePutInventoryItemDataResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// GetSshHostTagsWithResponse request returning *GetSshHostTagsResponse -func (c *ClientWithResponses) GetSshHostTagsWithResponse(ctx context.Context, params *GetSshHostTagsParams, reqEditors ...RequestEditorFn) (*GetSshHostTagsResponse, error) { - rsp, err := c.GetSshHostTags(ctx, params, reqEditors...) - if err != nil { - return nil, err } - return ParseGetSshHostTagsResponse(rsp) -} -// GetSshUsersWithResponse request returning *GetSshUsersResponse -func (c *ClientWithResponses) GetSshUsersWithResponse(ctx context.Context, params *GetSshUsersParams, reqEditors ...RequestEditorFn) (*GetSshUsersResponse, error) { - rsp, err := c.GetSshUsers(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetSshUsersResponse(rsp) + return response, nil } -// ParseGetAttestationAuthoritiesResponse parses an HTTP response from a GetAttestationAuthoritiesWithResponse call -func ParseGetAttestationAuthoritiesResponse(rsp *http.Response) (*GetAttestationAuthoritiesResponse, error) { +// ParseListAuthorityProvisionersResponse parses an HTTP response from a ListAuthorityProvisionersWithResponse call +func ParseListAuthorityProvisionersResponse(rsp *http.Response) (*ListAuthorityProvisionersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAttestationAuthoritiesResponse{ + response := &ListAuthorityProvisionersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []AttestationAuthority + var dest []Provisioner if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6010,6 +8772,13 @@ func ParseGetAttestationAuthoritiesResponse(rsp *http.Response) (*GetAttestation } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6022,22 +8791,22 @@ func ParseGetAttestationAuthoritiesResponse(rsp *http.Response) (*GetAttestation return response, nil } -// ParsePostAttestationAuthoritiesResponse parses an HTTP response from a PostAttestationAuthoritiesWithResponse call -func ParsePostAttestationAuthoritiesResponse(rsp *http.Response) (*PostAttestationAuthoritiesResponse, error) { +// ParsePostAuthorityProvisionersResponse parses an HTTP response from a PostAuthorityProvisionersWithResponse call +func ParsePostAuthorityProvisionersResponse(rsp *http.Response) (*PostAuthorityProvisionersResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostAttestationAuthoritiesResponse{ + response := &PostAuthorityProvisionersResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest AttestationAuthority + var dest Provisioner if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6057,19 +8826,19 @@ func ParsePostAttestationAuthoritiesResponse(rsp *http.Response) (*PostAttestati } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON409 = &dest + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON412 = &dest + response.JSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -6083,15 +8852,15 @@ func ParsePostAttestationAuthoritiesResponse(rsp *http.Response) (*PostAttestati return response, nil } -// ParseDeleteAttestationAuthorityResponse parses an HTTP response from a DeleteAttestationAuthorityWithResponse call -func ParseDeleteAttestationAuthorityResponse(rsp *http.Response) (*DeleteAttestationAuthorityResponse, error) { +// ParseDeleteProvisionerResponse parses an HTTP response from a DeleteProvisionerWithResponse call +func ParseDeleteProvisionerResponse(rsp *http.Response) (*DeleteProvisionerResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAttestationAuthorityResponse{ + response := &DeleteProvisionerResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -6123,22 +8892,22 @@ func ParseDeleteAttestationAuthorityResponse(rsp *http.Response) (*DeleteAttesta return response, nil } -// ParseGetAttestationAuthorityResponse parses an HTTP response from a GetAttestationAuthorityWithResponse call -func ParseGetAttestationAuthorityResponse(rsp *http.Response) (*GetAttestationAuthorityResponse, error) { +// ParseGetProvisionerResponse parses an HTTP response from a GetProvisionerWithResponse call +func ParseGetProvisionerResponse(rsp *http.Response) (*GetProvisionerResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAttestationAuthorityResponse{ + response := &GetProvisionerResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest AttestationAuthority + var dest Provisioner if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6177,24 +8946,22 @@ func ParseGetAttestationAuthorityResponse(rsp *http.Response) (*GetAttestationAu return response, nil } -// ParsePostAuthResponse parses an HTTP response from a PostAuthWithResponse call -func ParsePostAuthResponse(rsp *http.Response) (*PostAuthResponse, error) { +// ParsePostWebhooksResponse parses an HTTP response from a PostWebhooksWithResponse call +func ParsePostWebhooksResponse(rsp *http.Response) (*PostWebhooksResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostAuthResponse{ + response := &PostWebhooksResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest struct { - Token *string `json:"token,omitempty"` - } + var dest ProvisionerWebhook if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6214,12 +8981,26 @@ func ParsePostAuthResponse(rsp *http.Response) (*PostAuthResponse, error) { } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON412 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -6233,27 +9014,20 @@ func ParsePostAuthResponse(rsp *http.Response) (*PostAuthResponse, error) { return response, nil } -// ParseGetAuthoritiesResponse parses an HTTP response from a GetAuthoritiesWithResponse call -func ParseGetAuthoritiesResponse(rsp *http.Response) (*GetAuthoritiesResponse, error) { +// ParseDeleteWebhookResponse parses an HTTP response from a DeleteWebhookWithResponse call +func ParseDeleteWebhookResponse(rsp *http.Response) (*DeleteWebhookResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAuthoritiesResponse{ + response := &DeleteWebhookResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Authority - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6280,33 +9054,26 @@ func ParseGetAuthoritiesResponse(rsp *http.Response) (*GetAuthoritiesResponse, e return response, nil } -// ParsePostAuthoritiesResponse parses an HTTP response from a PostAuthoritiesWithResponse call -func ParsePostAuthoritiesResponse(rsp *http.Response) (*PostAuthoritiesResponse, error) { +// ParseGetWebhookResponse parses an HTTP response from a GetWebhookWithResponse call +func ParseGetWebhookResponse(rsp *http.Response) (*GetWebhookResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostAuthoritiesResponse{ + response := &GetWebhookResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Authority - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ProvisionerWebhook if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Error @@ -6315,19 +9082,12 @@ func ParsePostAuthoritiesResponse(rsp *http.Response) (*PostAuthoritiesResponse, } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON412 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -6341,26 +9101,26 @@ func ParsePostAuthoritiesResponse(rsp *http.Response) (*PostAuthoritiesResponse, return response, nil } -// ParsePostAuthoritiesCsrResponse parses an HTTP response from a PostAuthoritiesCsrWithResponse call -func ParsePostAuthoritiesCsrResponse(rsp *http.Response) (*PostAuthoritiesCsrResponse, error) { +// ParsePostAuthorityRootResponse parses an HTTP response from a PostAuthorityRootWithResponse call +func ParsePostAuthorityRootResponse(rsp *http.Response) (*PostAuthorityRootResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostAuthoritiesCsrResponse{ + response := &PostAuthorityRootResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest AuthorityCsr + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Authority if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -6376,19 +9136,12 @@ func ParsePostAuthoritiesCsrResponse(rsp *http.Response) (*PostAuthoritiesCsrRes } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON412 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -6402,20 +9155,27 @@ func ParsePostAuthoritiesCsrResponse(rsp *http.Response) (*PostAuthoritiesCsrRes return response, nil } -// ParseDeleteAuthorityResponse parses an HTTP response from a DeleteAuthorityWithResponse call -func ParseDeleteAuthorityResponse(rsp *http.Response) (*DeleteAuthorityResponse, error) { +// ParseListCollectionsResponse parses an HTTP response from a ListCollectionsWithResponse call +func ParseListCollectionsResponse(rsp *http.Response) (*ListCollectionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAuthorityResponse{ + response := &ListCollectionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Collection + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6442,26 +9202,26 @@ func ParseDeleteAuthorityResponse(rsp *http.Response) (*DeleteAuthorityResponse, return response, nil } -// ParseGetAuthorityResponse parses an HTTP response from a GetAuthorityWithResponse call -func ParseGetAuthorityResponse(rsp *http.Response) (*GetAuthorityResponse, error) { +// ParsePostCollectionsResponse parses an HTTP response from a PostCollectionsWithResponse call +func ParsePostCollectionsResponse(rsp *http.Response) (*PostCollectionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAuthorityResponse{ + response := &PostCollectionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Authority + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Collection if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -6477,12 +9237,12 @@ func ParseGetAuthorityResponse(rsp *http.Response) (*GetAuthorityResponse, error } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -6496,27 +9256,20 @@ func ParseGetAuthorityResponse(rsp *http.Response) (*GetAuthorityResponse, error return response, nil } -// ParseListAuthorityProvisionersResponse parses an HTTP response from a ListAuthorityProvisionersWithResponse call -func ParseListAuthorityProvisionersResponse(rsp *http.Response) (*ListAuthorityProvisionersResponse, error) { +// ParseDeleteCollectionResponse parses an HTTP response from a DeleteCollectionWithResponse call +func ParseDeleteCollectionResponse(rsp *http.Response) (*DeleteCollectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListAuthorityProvisionersResponse{ + response := &DeleteCollectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Provisioner - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6524,20 +9277,6 @@ func ParseListAuthorityProvisionersResponse(rsp *http.Response) (*ListAuthorityP } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6550,26 +9289,26 @@ func ParseListAuthorityProvisionersResponse(rsp *http.Response) (*ListAuthorityP return response, nil } -// ParsePostAuthorityProvisionersResponse parses an HTTP response from a PostAuthorityProvisionersWithResponse call -func ParsePostAuthorityProvisionersResponse(rsp *http.Response) (*PostAuthorityProvisionersResponse, error) { +// ParseGetCollectionResponse parses an HTTP response from a GetCollectionWithResponse call +func ParseGetCollectionResponse(rsp *http.Response) (*GetCollectionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostAuthorityProvisionersResponse{ + response := &GetCollectionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Provisioner + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Collection if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -6592,13 +9331,6 @@ func ParsePostAuthorityProvisionersResponse(rsp *http.Response) (*PostAuthorityP } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6611,15 +9343,15 @@ func ParsePostAuthorityProvisionersResponse(rsp *http.Response) (*PostAuthorityP return response, nil } -// ParseDeleteProvisionerResponse parses an HTTP response from a DeleteProvisionerWithResponse call -func ParseDeleteProvisionerResponse(rsp *http.Response) (*DeleteProvisionerResponse, error) { +// ParseDeleteCollectionInstanceResponse parses an HTTP response from a DeleteCollectionInstanceWithResponse call +func ParseDeleteCollectionInstanceResponse(rsp *http.Response) (*DeleteCollectionInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteProvisionerResponse{ + response := &DeleteCollectionInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -6651,22 +9383,22 @@ func ParseDeleteProvisionerResponse(rsp *http.Response) (*DeleteProvisionerRespo return response, nil } -// ParseGetProvisionerResponse parses an HTTP response from a GetProvisionerWithResponse call -func ParseGetProvisionerResponse(rsp *http.Response) (*GetProvisionerResponse, error) { +// ParseGetCollectionInstanceResponse parses an HTTP response from a GetCollectionInstanceWithResponse call +func ParseGetCollectionInstanceResponse(rsp *http.Response) (*GetCollectionInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetProvisionerResponse{ + response := &GetCollectionInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Provisioner + var dest CollectionInstance if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6705,22 +9437,22 @@ func ParseGetProvisionerResponse(rsp *http.Response) (*GetProvisionerResponse, e return response, nil } -// ParsePostAuthorityRootResponse parses an HTTP response from a PostAuthorityRootWithResponse call -func ParsePostAuthorityRootResponse(rsp *http.Response) (*PostAuthorityRootResponse, error) { +// ParsePutCollectionInstanceResponse parses an HTTP response from a PutCollectionInstanceWithResponse call +func ParsePutCollectionInstanceResponse(rsp *http.Response) (*PutCollectionInstanceResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostAuthorityRootResponse{ + response := &PutCollectionInstanceResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Authority + var dest CollectionInstance if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6740,13 +9472,6 @@ func ParsePostAuthorityRootResponse(rsp *http.Response) (*PostAuthorityRootRespo } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6759,26 +9484,33 @@ func ParsePostAuthorityRootResponse(rsp *http.Response) (*PostAuthorityRootRespo return response, nil } -// ParseGetSshGrantsResponse parses an HTTP response from a GetSshGrantsWithResponse call -func ParseGetSshGrantsResponse(rsp *http.Response) (*GetSshGrantsResponse, error) { +// ParseGetCollectionInstanceDataResponse parses an HTTP response from a GetCollectionInstanceDataWithResponse call +func ParseGetCollectionInstanceDataResponse(rsp *http.Response) (*GetCollectionInstanceDataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSshGrantsResponse{ + response := &GetCollectionInstanceDataResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Grant + var dest interface{} + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Error @@ -6787,6 +9519,13 @@ func ParseGetSshGrantsResponse(rsp *http.Response) (*GetSshGrantsResponse, error } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6799,26 +9538,26 @@ func ParseGetSshGrantsResponse(rsp *http.Response) (*GetSshGrantsResponse, error return response, nil } -// ParsePostSshGrantsResponse parses an HTTP response from a PostSshGrantsWithResponse call -func ParsePostSshGrantsResponse(rsp *http.Response) (*PostSshGrantsResponse, error) { +// ParsePutCollectionInstanceDataResponse parses an HTTP response from a PutCollectionInstanceDataWithResponse call +func ParsePutCollectionInstanceDataResponse(rsp *http.Response) (*PutCollectionInstanceDataResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostSshGrantsResponse{ + response := &PutCollectionInstanceDataResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Grant + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest interface{} if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -6846,20 +9585,27 @@ func ParsePostSshGrantsResponse(rsp *http.Response) (*PostSshGrantsResponse, err return response, nil } -// ParseDeleteSshGrantResponse parses an HTTP response from a DeleteSshGrantWithResponse call -func ParseDeleteSshGrantResponse(rsp *http.Response) (*DeleteSshGrantResponse, error) { +// ParseListCollectionInstancesResponse parses an HTTP response from a ListCollectionInstancesWithResponse call +func ParseListCollectionInstancesResponse(rsp *http.Response) (*ListCollectionInstancesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteSshGrantResponse{ + response := &ListCollectionInstancesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []CollectionInstance + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6874,6 +9620,13 @@ func ParseDeleteSshGrantResponse(rsp *http.Response) (*DeleteSshGrantResponse, e } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6886,26 +9639,26 @@ func ParseDeleteSshGrantResponse(rsp *http.Response) (*DeleteSshGrantResponse, e return response, nil } -// ParseGetSshGrantResponse parses an HTTP response from a GetSshGrantWithResponse call -func ParseGetSshGrantResponse(rsp *http.Response) (*GetSshGrantResponse, error) { +// ParsePostEndpointConfigurationsResponse parses an HTTP response from a PostEndpointConfigurationsWithResponse call +func ParsePostEndpointConfigurationsResponse(rsp *http.Response) (*PostEndpointConfigurationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSshGrantResponse{ + response := &PostEndpointConfigurationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Grant + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest EndpointConfiguration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -6921,12 +9674,12 @@ func ParseGetSshGrantResponse(rsp *http.Response) (*GetSshGrantResponse, error) } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 412: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON412 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -6940,27 +9693,20 @@ func ParseGetSshGrantResponse(rsp *http.Response) (*GetSshGrantResponse, error) return response, nil } -// ParseGetSshGroupsResponse parses an HTTP response from a GetSshGroupsWithResponse call -func ParseGetSshGroupsResponse(rsp *http.Response) (*GetSshGroupsResponse, error) { +// ParseDeleteEndpointConfigurationResponse parses an HTTP response from a DeleteEndpointConfigurationWithResponse call +func ParseDeleteEndpointConfigurationResponse(rsp *http.Response) (*DeleteEndpointConfigurationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSshGroupsResponse{ + response := &DeleteEndpointConfigurationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Group - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6968,13 +9714,6 @@ func ParseGetSshGroupsResponse(rsp *http.Response) (*GetSshGroupsResponse, error } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6987,22 +9726,22 @@ func ParseGetSshGroupsResponse(rsp *http.Response) (*GetSshGroupsResponse, error return response, nil } -// ParseGetSshGroupResponse parses an HTTP response from a GetSshGroupWithResponse call -func ParseGetSshGroupResponse(rsp *http.Response) (*GetSshGroupResponse, error) { +// ParseGetEndpointConfigurationResponse parses an HTTP response from a GetEndpointConfigurationWithResponse call +func ParseGetEndpointConfigurationResponse(rsp *http.Response) (*GetEndpointConfigurationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSshGroupResponse{ + response := &GetEndpointConfigurationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Group + var dest EndpointConfiguration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7041,34 +9780,27 @@ func ParseGetSshGroupResponse(rsp *http.Response) (*GetSshGroupResponse, error) return response, nil } -// ParseGetSshHostsResponse parses an HTTP response from a GetSshHostsWithResponse call -func ParseGetSshHostsResponse(rsp *http.Response) (*GetSshHostsResponse, error) { +// ParseGetSshGrantsResponse parses an HTTP response from a GetSshGrantsWithResponse call +func ParseGetSshGrantsResponse(rsp *http.Response) (*GetSshGrantsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSshHostsResponse{ + response := &GetSshGrantsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Host + var dest []Grant if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7088,26 +9820,26 @@ func ParseGetSshHostsResponse(rsp *http.Response) (*GetSshHostsResponse, error) return response, nil } -// ParseGetSshHostResponse parses an HTTP response from a GetSshHostWithResponse call -func ParseGetSshHostResponse(rsp *http.Response) (*GetSshHostResponse, error) { +// ParsePostSshGrantsResponse parses an HTTP response from a PostSshGrantsWithResponse call +func ParsePostSshGrantsResponse(rsp *http.Response) (*PostSshGrantsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetSshHostResponse{ + response := &PostSshGrantsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Host + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Grant if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -7123,13 +9855,6 @@ func ParseGetSshHostResponse(rsp *http.Response) (*GetSshHostResponse, error) { } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7142,27 +9867,20 @@ func ParseGetSshHostResponse(rsp *http.Response) (*GetSshHostResponse, error) { return response, nil } -// ParsePostHostsHostIDTagsResponse parses an HTTP response from a PostHostsHostIDTagsWithResponse call -func ParsePostHostsHostIDTagsResponse(rsp *http.Response) (*PostHostsHostIDTagsResponse, error) { +// ParseDeleteSshGrantResponse parses an HTTP response from a DeleteSshGrantWithResponse call +func ParseDeleteSshGrantResponse(rsp *http.Response) (*DeleteSshGrantResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostHostsHostIDTagsResponse{ + response := &DeleteSshGrantResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Tag - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON201 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7177,13 +9895,6 @@ func ParsePostHostsHostIDTagsResponse(rsp *http.Response) (*PostHostsHostIDTagsR } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7196,22 +9907,22 @@ func ParsePostHostsHostIDTagsResponse(rsp *http.Response) (*PostHostsHostIDTagsR return response, nil } -// ParseUnregisterSshHostResponse parses an HTTP response from a UnregisterSshHostWithResponse call -func ParseUnregisterSshHostResponse(rsp *http.Response) (*UnregisterSshHostResponse, error) { +// ParseGetSshGrantResponse parses an HTTP response from a GetSshGrantWithResponse call +func ParseGetSshGrantResponse(rsp *http.Response) (*GetSshGrantResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UnregisterSshHostResponse{ + response := &GetSshGrantResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Host + var dest Grant if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7231,6 +9942,13 @@ func ParseUnregisterSshHostResponse(rsp *http.Response) (*UnregisterSshHostRespo } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7243,22 +9961,22 @@ func ParseUnregisterSshHostResponse(rsp *http.Response) (*UnregisterSshHostRespo return response, nil } -// ParseListInventoriesResponse parses an HTTP response from a ListInventoriesWithResponse call -func ParseListInventoriesResponse(rsp *http.Response) (*ListInventoriesResponse, error) { +// ParseGetSshGroupsResponse parses an HTTP response from a GetSshGroupsWithResponse call +func ParseGetSshGroupsResponse(rsp *http.Response) (*GetSshGroupsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListInventoriesResponse{ + response := &GetSshGroupsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []Inventory + var dest []Group if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7290,26 +10008,26 @@ func ParseListInventoriesResponse(rsp *http.Response) (*ListInventoriesResponse, return response, nil } -// ParsePostInventoriesResponse parses an HTTP response from a PostInventoriesWithResponse call -func ParsePostInventoriesResponse(rsp *http.Response) (*PostInventoriesResponse, error) { +// ParseGetSshGroupResponse parses an HTTP response from a GetSshGroupWithResponse call +func ParseGetSshGroupResponse(rsp *http.Response) (*GetSshGroupResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PostInventoriesResponse{ + response := &GetSshGroupResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Inventory + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Group if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -7325,12 +10043,12 @@ func ParsePostInventoriesResponse(rsp *http.Response) (*PostInventoriesResponse, } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON409 = &dest + response.JSON404 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error @@ -7344,20 +10062,27 @@ func ParsePostInventoriesResponse(rsp *http.Response) (*PostInventoriesResponse, return response, nil } -// ParseDeleteInventoryResponse parses an HTTP response from a DeleteInventoryWithResponse call -func ParseDeleteInventoryResponse(rsp *http.Response) (*DeleteInventoryResponse, error) { +// ParseGetSshHostsResponse parses an HTTP response from a GetSshHostsWithResponse call +func ParseGetSshHostsResponse(rsp *http.Response) (*GetSshHostsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteInventoryResponse{ + response := &GetSshHostsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []Host + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7365,6 +10090,13 @@ func ParseDeleteInventoryResponse(rsp *http.Response) (*DeleteInventoryResponse, } response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7377,22 +10109,22 @@ func ParseDeleteInventoryResponse(rsp *http.Response) (*DeleteInventoryResponse, return response, nil } -// ParseGetInventoryResponse parses an HTTP response from a GetInventoryWithResponse call -func ParseGetInventoryResponse(rsp *http.Response) (*GetInventoryResponse, error) { +// ParseGetSshHostResponse parses an HTTP response from a GetSshHostWithResponse call +func ParseGetSshHostResponse(rsp *http.Response) (*GetSshHostResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetInventoryResponse{ + response := &GetSshHostResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Inventory + var dest Host if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7431,26 +10163,26 @@ func ParseGetInventoryResponse(rsp *http.Response) (*GetInventoryResponse, error return response, nil } -// ParseListInventoryItemsResponse parses an HTTP response from a ListInventoryItemsWithResponse call -func ParseListInventoryItemsResponse(rsp *http.Response) (*ListInventoryItemsResponse, error) { +// ParsePostHostsHostIDTagsResponse parses an HTTP response from a PostHostsHostIDTagsWithResponse call +func ParsePostHostsHostIDTagsResponse(rsp *http.Response) (*PostHostsHostIDTagsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListInventoryItemsResponse{ + response := &PostHostsHostIDTagsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest []InventoryItem + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Tag if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -7485,20 +10217,27 @@ func ParseListInventoryItemsResponse(rsp *http.Response) (*ListInventoryItemsRes return response, nil } -// ParseDeleteInventoryItemResponse parses an HTTP response from a DeleteInventoryItemWithResponse call -func ParseDeleteInventoryItemResponse(rsp *http.Response) (*DeleteInventoryItemResponse, error) { +// ParseUnregisterSshHostResponse parses an HTTP response from a UnregisterSshHostWithResponse call +func ParseUnregisterSshHostResponse(rsp *http.Response) (*UnregisterSshHostResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteInventoryItemResponse{ + response := &UnregisterSshHostResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Host + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7525,26 +10264,26 @@ func ParseDeleteInventoryItemResponse(rsp *http.Response) (*DeleteInventoryItemR return response, nil } -// ParseGetInventoryItemResponse parses an HTTP response from a GetInventoryItemWithResponse call -func ParseGetInventoryItemResponse(rsp *http.Response) (*GetInventoryItemResponse, error) { +// ParsePostManagedConfigurationsResponse parses an HTTP response from a PostManagedConfigurationsWithResponse call +func ParsePostManagedConfigurationsResponse(rsp *http.Response) (*PostManagedConfigurationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetInventoryItemResponse{ + response := &PostManagedConfigurationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest InventoryItem + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest ManagedConfiguration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error @@ -7560,13 +10299,6 @@ func ParseGetInventoryItemResponse(rsp *http.Response) (*GetInventoryItemRespons } response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7579,27 +10311,20 @@ func ParseGetInventoryItemResponse(rsp *http.Response) (*GetInventoryItemRespons return response, nil } -// ParsePutInventoryItemResponse parses an HTTP response from a PutInventoryItemWithResponse call -func ParsePutInventoryItemResponse(rsp *http.Response) (*PutInventoryItemResponse, error) { +// ParseDeleteManagedConfigurationHostIdResponse parses an HTTP response from a DeleteManagedConfigurationHostIdWithResponse call +func ParseDeleteManagedConfigurationHostIdResponse(rsp *http.Response) (*DeleteManagedConfigurationHostIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PutInventoryItemResponse{ + response := &DeleteManagedConfigurationHostIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest InventoryItem - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7607,13 +10332,6 @@ func ParsePutInventoryItemResponse(rsp *http.Response) (*PutInventoryItemRespons } response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -7626,22 +10344,22 @@ func ParsePutInventoryItemResponse(rsp *http.Response) (*PutInventoryItemRespons return response, nil } -// ParseGetInventoryItemDataResponse parses an HTTP response from a GetInventoryItemDataWithResponse call -func ParseGetInventoryItemDataResponse(rsp *http.Response) (*GetInventoryItemDataResponse, error) { +// ParseGetManagedConfigurationHostIdResponse parses an HTTP response from a GetManagedConfigurationHostIdWithResponse call +func ParseGetManagedConfigurationHostIdResponse(rsp *http.Response) (*GetManagedConfigurationHostIdResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetInventoryItemDataResponse{ + response := &GetManagedConfigurationHostIdResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} + var dest ManagedConfiguration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7680,22 +10398,55 @@ func ParseGetInventoryItemDataResponse(rsp *http.Response) (*GetInventoryItemDat return response, nil } -// ParsePutInventoryItemDataResponse parses an HTTP response from a PutInventoryItemDataWithResponse call -func ParsePutInventoryItemDataResponse(rsp *http.Response) (*PutInventoryItemDataResponse, error) { +// ParseDeleteManagedConfigurationResponse parses an HTTP response from a DeleteManagedConfigurationWithResponse call +func ParseDeleteManagedConfigurationResponse(rsp *http.Response) (*DeleteManagedConfigurationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteManagedConfigurationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseGetManagedConfigurationResponse parses an HTTP response from a GetManagedConfigurationWithResponse call +func ParseGetManagedConfigurationResponse(rsp *http.Response) (*GetManagedConfigurationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PutInventoryItemDataResponse{ + response := &GetManagedConfigurationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest interface{} + var dest ManagedConfiguration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -7715,6 +10466,13 @@ func ParsePutInventoryItemDataResponse(rsp *http.Response) (*PutInventoryItemDat } response.JSON401 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest Error if err := json.Unmarshal(bodyBytes, &dest); err != nil { diff --git a/internal/apiserver/v20230301/api.gen.go b/internal/apiserver/v20230301/api.gen.go index cf1cf55..11c9476 100644 --- a/internal/apiserver/v20230301/api.gen.go +++ b/internal/apiserver/v20230301/api.gen.go @@ -47,6 +47,47 @@ const ( AuthorityTypeDevops AuthorityType = "devops" ) +// Defines values for EndpointCertificateInfoType. +const ( + EndpointCertificateInfoTypeSSHHOST EndpointCertificateInfoType = "SSH_HOST" + EndpointCertificateInfoTypeSSHUSER EndpointCertificateInfoType = "SSH_USER" + EndpointCertificateInfoTypeX509 EndpointCertificateInfoType = "X509" +) + +// Defines values for EndpointConfigurationKind. +const ( + DEVICE EndpointConfigurationKind = "DEVICE" + PEOPLE EndpointConfigurationKind = "PEOPLE" + WORKLOAD EndpointConfigurationKind = "WORKLOAD" +) + +// Defines values for EndpointKeyInfoFormat. +const ( + EndpointKeyInfoFormatDEFAULT EndpointKeyInfoFormat = "DEFAULT" + EndpointKeyInfoFormatDER EndpointKeyInfoFormat = "DER" + EndpointKeyInfoFormatOPENSSH EndpointKeyInfoFormat = "OPENSSH" + EndpointKeyInfoFormatPKCS8 EndpointKeyInfoFormat = "PKCS8" +) + +// Defines values for EndpointKeyInfoType. +const ( + EndpointKeyInfoTypeDEFAULT EndpointKeyInfoType = "DEFAULT" + EndpointKeyInfoTypeECDSAP256 EndpointKeyInfoType = "ECDSA_P256" + EndpointKeyInfoTypeECDSAP384 EndpointKeyInfoType = "ECDSA_P384" + EndpointKeyInfoTypeECDSAP521 EndpointKeyInfoType = "ECDSA_P521" + EndpointKeyInfoTypeED25519 EndpointKeyInfoType = "ED25519" + EndpointKeyInfoTypeRSA2048 EndpointKeyInfoType = "RSA_2048" + EndpointKeyInfoTypeRSA3072 EndpointKeyInfoType = "RSA_3072" + EndpointKeyInfoTypeRSA4096 EndpointKeyInfoType = "RSA_4096" +) + +// Defines values for EndpointReloadInfoMethod. +const ( + AUTOMATIC EndpointReloadInfoMethod = "AUTOMATIC" + CUSTOM EndpointReloadInfoMethod = "CUSTOM" + SIGNAL EndpointReloadInfoMethod = "SIGNAL" +) + // Defines values for NewAuthorityType. const ( NewAuthorityTypeAdvanced NewAuthorityType = "advanced" @@ -62,11 +103,22 @@ const ( X5C ProvisionerType = "X5C" ) -// Defines values for WebhookCertType. +// Defines values for ProvisionerWebhookCertType. +const ( + ProvisionerWebhookCertTypeALL ProvisionerWebhookCertType = "ALL" + ProvisionerWebhookCertTypeSSH ProvisionerWebhookCertType = "SSH" + ProvisionerWebhookCertTypeX509 ProvisionerWebhookCertType = "X509" +) + +// Defines values for ProvisionerWebhookKind. +const ( + ENRICHING ProvisionerWebhookKind = "ENRICHING" +) + +// Defines values for ProvisionerWebhookServerType. const ( - ALL WebhookCertType = "ALL" - SSH WebhookCertType = "SSH" - X509 WebhookCertType = "X509" + EXTERNAL ProvisionerWebhookServerType = "EXTERNAL" + HOSTEDATTESTATION ProvisionerWebhookServerType = "HOSTED_ATTESTATION" ) // Defines values for X509IssuerKeyVersion. @@ -121,6 +173,24 @@ type AcmeProvisioner struct { // AcmeProvisionerChallenges defines model for AcmeProvisioner.Challenges. type AcmeProvisionerChallenges string +// AgentConfiguration The agent configuration describes the attestation authority used by the agent to grant workload certificates. +type AgentConfiguration struct { + // AttestationSlug The slug of the attestation authority the agent connects to to get a certificate. + AttestationSlug *string `json:"attestationSlug,omitempty"` + + // AuthorityID UUID identifying the authority the agent uses to generate endpoint certificates. + AuthorityID string `json:"authorityID"` + + // Id A UUID identifying this agent configuration. Generated server-side on creation. + Id *string `json:"id,omitempty"` + + // Name The name of this agent configuration. + Name string `json:"name"` + + // Provisioner The name of the provisioner on the authority the agent uses to generate endpoint certificates. + Provisioner string `json:"provisioner"` +} + // AttestationAuthority An attestation authority used with the device-attest-01 ACME challenge to verify a device's hardware identity. This object is experimental and subject to change. type AttestationAuthority struct { // AttestorIntermediates The pem-encoded list of intermediate certificates used to build a chain of trust to verify the attestation certificates submitted by devices. @@ -129,7 +199,7 @@ type AttestationAuthority struct { // AttestorRoots The pem-encoded list of certificates used to verify the attestation certificates submitted by devices. AttestorRoots string `json:"attestorRoots"` - // Catalog The slug of an inventory that holds the list of devices belonging to the team + // Catalog The slug of a collection that holds the list of devices belonging to the team Catalog string `json:"catalog"` // CreatedAt Timestamp in RFC3339 format when the attestation authority was created @@ -190,6 +260,40 @@ type AuthorityCsr struct { // AuthorityType One of the available authority types type AuthorityType string +// BasicAuth Configures provisioner webhook requests to include an Authorization header with these credentials. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. At most one of `bearerToken` and `basicAuth` may be set. +type BasicAuth struct { + Password string `json:"password"` + Username string `json:"username"` +} + +// Collection A collection of instances +type Collection struct { + CreatedAt time.Time `json:"createdAt"` + + // DisplayName A user-friendly name for the collection + DisplayName string `json:"displayName"` + + // InstanceCount The number of instances in the collection + InstanceCount int `json:"instanceCount"` + + // Slug A lowercase name identifying the collection. + Slug string `json:"slug"` + UpdatedAt time.Time `json:"updatedAt"` +} + +// CollectionInstance An instance in a collection +type CollectionInstance struct { + // CreatedAt Timestamp of when the instance was added to the collection + CreatedAt time.Time `json:"createdAt"` + + // Data The instance data + Data interface{} `json:"data"` + Id string `json:"id"` + + // UpdatedAt Timestamp of when the instance was last changed + UpdatedAt time.Time `json:"updatedAt"` +} + // DistinguishedName Name used in x509 certificates type DistinguishedName struct { CommonName *string `json:"commonName,omitempty"` @@ -210,6 +314,144 @@ type Email struct { Primary *bool `json:"primary,omitempty"` } +// EndpointCertificateInfo Details on a managed certificate +type EndpointCertificateInfo struct { + // CrtFile The filepath where the certificate is to be stored. + CrtFile *string `json:"crtFile,omitempty"` + + // Duration The certificate lifetime. Parsed as a [Golang duration](https://pkg.go.dev/time#ParseDuration). + Duration *string `json:"duration,omitempty"` + + // Gid GID of the files where the certificate is stored. + Gid *int `json:"gid,omitempty"` + + // KeyFile The filepath where the key is to be stored. + KeyFile *string `json:"keyFile,omitempty"` + + // Mode Permission bits of the files where the certificate is stored. + Mode *int `json:"mode,omitempty"` + + // RootFile The filepath where the root certificate is to be stored. + RootFile *string `json:"rootFile,omitempty"` + + // Type The type of certificate + Type EndpointCertificateInfoType `json:"type"` + + // Uid UID of the files where the certificate is stored. + Uid *int `json:"uid,omitempty"` +} + +// EndpointCertificateInfoType The type of certificate +type EndpointCertificateInfoType string + +// EndpointConfiguration Configuration for a managed endpoint +type EndpointConfiguration struct { + // AuthorityID UUID identifying the authority that will issue certificates for the endpoint. + AuthorityID string `json:"authorityID"` + + // CertificateInfo Details on a managed certificate + CertificateInfo EndpointCertificateInfo `json:"certificateInfo"` + + // Hooks The collection of commands to run when a certificate for a managed endpoint is signed or renewed. + Hooks *EndpointHooks `json:"hooks,omitempty"` + + // Id A UUID identifying this endpoint configuration. Generated server-side when the endpoint configuration is created. + Id *string `json:"id,omitempty"` + + // KeyInfo The attributes of the cryptographic key. + KeyInfo *EndpointKeyInfo `json:"keyInfo,omitempty"` + + // Kind The kind of endpoint this configuration applies to. + Kind EndpointConfigurationKind `json:"kind"` + + // Name The name of the endpoint configuration. + Name string `json:"name"` + + // Provisioner Name of the provisioner on the authority that will authorize certificates for the endpoint. + Provisioner string `json:"provisioner"` + + // ReloadInfo The properties used to reload a service. + ReloadInfo *EndpointReloadInfo `json:"reloadInfo,omitempty"` +} + +// EndpointConfigurationKind The kind of endpoint this configuration applies to. +type EndpointConfigurationKind string + +// EndpointHook A list of commands to run before and after a certificate is granted. +type EndpointHook struct { + // After List of commands to run after the operation. + After *[]string `json:"after,omitempty"` + + // Before List of commands to run before the operation. + Before *[]string `json:"before,omitempty"` + + // OnError List of commands to run when the operation fails. + OnError *[]string `json:"onError,omitempty"` + + // Shell The shell to use to execute the commands. + Shell *string `json:"shell,omitempty"` +} + +// EndpointHooks The collection of commands to run when a certificate for a managed endpoint is signed or renewed. +type EndpointHooks struct { + // Renew A list of commands to run before and after a certificate is granted. + Renew *EndpointHook `json:"renew,omitempty"` + + // Sign A list of commands to run before and after a certificate is granted. + Sign *EndpointHook `json:"sign,omitempty"` +} + +// EndpointKeyInfo The attributes of the cryptographic key. +type EndpointKeyInfo struct { + // Format The format used to encode the private key. For X509 keys the default format is SEC 1 for ECDSA keys, PKCS#1 for RSA keys and PKCS#8 for ED25519 keys. For SSH keys the default format is always the OPENSSH format. + Format *EndpointKeyInfoFormat `json:"format,omitempty"` + + // PubFile A CSR or SSH public key to use instead of generating one. + PubFile *string `json:"pubFile,omitempty"` + + // Type The key type used. The current DEFAULT type is ECDSA_P256. + Type *EndpointKeyInfoType `json:"type,omitempty"` +} + +// EndpointKeyInfoFormat The format used to encode the private key. For X509 keys the default format is SEC 1 for ECDSA keys, PKCS#1 for RSA keys and PKCS#8 for ED25519 keys. For SSH keys the default format is always the OPENSSH format. +type EndpointKeyInfoFormat string + +// EndpointKeyInfoType The key type used. The current DEFAULT type is ECDSA_P256. +type EndpointKeyInfoType string + +// EndpointReloadInfo The properties used to reload a service. +type EndpointReloadInfo struct { + // Method Ways an endpoint can reload a certificate. `AUTOMATIC` means the process is able to detect and reload new certificates automatically. `CUSTOM` means a custom command must be run to trigger the workload to reload the certificates. `SIGNAL` will configure the agent to send a signal to the process in pidFile. + Method EndpointReloadInfoMethod `json:"method"` + + // PidFile File that holds the pid of the process to signal. Required when method is SIGNAL. + PidFile *string `json:"pidFile,omitempty"` + + // Signal The signal to send to a process when a certificate should be reloaded. Required when method is SIGNAL. + Signal *int `json:"signal,omitempty"` +} + +// EndpointReloadInfoMethod Ways an endpoint can reload a certificate. `AUTOMATIC` means the process is able to detect and reload new certificates automatically. `CUSTOM` means a custom command must be run to trigger the workload to reload the certificates. `SIGNAL` will configure the agent to send a signal to the process in pidFile. +type EndpointReloadInfoMethod string + +// EndpointSSHCertificateData Contains the information to include when granting an SSH certificate to an endpoint. +type EndpointSSHCertificateData struct { + // KeyID The key ID to include in the endpoint certificate. + KeyID string `json:"keyID"` + + // Principals The principals to include in the endpoint certificate. + Principals []string `json:"principals"` +} + +// EndpointX509CertificateData Contains the information to include when granting an x509 certificate to an endpoint. +type EndpointX509CertificateData struct { + // CommonName The Common Name to be used in the subject of the endpoint certificate. + CommonName string `json:"commonName"` + + // Sans The list of SANs to include in the endpoint certificate. + Sans []string `json:"sans"` +} + // Error defines model for error. type Error struct { // Message A description of the error @@ -274,41 +516,44 @@ type Host struct { UpdatedAt *time.Time `json:"updatedAt,omitempty"` } -// Inventory A collection of items -type Inventory struct { - CreatedAt time.Time `json:"createdAt"` - - // DisplayName A user-friendly name for the inventory - DisplayName string `json:"displayName"` - - // ItemCount The number of items in the inventory - ItemCount int `json:"itemCount"` +// JwkProvisioner defines model for jwkProvisioner. +type JwkProvisioner struct { + // EncryptedKey The JWE encrypted private key + EncryptedKey *string `json:"encryptedKey,omitempty"` - // Slug A lowercase name identifying the inventory. - Slug string `json:"slug"` - UpdatedAt time.Time `json:"updatedAt"` + // Key The public JSON web key + Key interface{} `json:"key"` } -// InventoryItem An item in an inventory -type InventoryItem struct { - // CreatedAt Timestamp of when the item was added to the inventory - CreatedAt time.Time `json:"createdAt"` +// ManagedConfiguration The agent and managed endpoints used in one host. +type ManagedConfiguration struct { + // AgentConfigurationID UUID identifying the agent configuration. + AgentConfigurationID string `json:"agentConfigurationID"` - // Data The item data - Data interface{} `json:"data"` - Id string `json:"id"` + // HostID UUID identifying the host this managed configuration is for. Will be generated on server-side if not provided. + HostID *string `json:"hostID,omitempty"` - // UpdatedAt Timestamp of when the item was last changed - UpdatedAt time.Time `json:"updatedAt"` + // Id UUID identifying this managed configuration. + Id *string `json:"id,omitempty"` + ManagedEndpoints []ManagedEndpoint `json:"managedEndpoints"` + + // Name The name of this managed configuration. + Name string `json:"name"` } -// JwkProvisioner defines model for jwkProvisioner. -type JwkProvisioner struct { - // EncryptedKey The JWE encrypted private key - EncryptedKey *string `json:"encryptedKey,omitempty"` +// ManagedEndpoint All the information used by an agent to grant a certificate to an endpoint. Exactly one of `x509CertificateData` or `sshCertificateData` must be set and must match the endpoint configuration certificate info type. +type ManagedEndpoint struct { + // EndpointConfigurationID UUID identifying the endpoint configuration. + EndpointConfigurationID string `json:"endpointConfigurationID"` - // Key The public JSON web key - Key interface{} `json:"key"` + // Id UUID identifying this managed endpoint. Generated server-side on creation. + Id *string `json:"id,omitempty"` + + // SshCertificateData Contains the information to include when granting an SSH certificate to an endpoint. + SshCertificateData *EndpointSSHCertificateData `json:"sshCertificateData,omitempty"` + + // X509CertificateData Contains the information to include when granting an x509 certificate to an endpoint. + X509CertificateData *EndpointX509CertificateData `json:"x509CertificateData,omitempty"` } // NameConstraints defines model for name-constraints. @@ -367,6 +612,15 @@ type NewAuthorityCsr struct { Subdomain string `json:"subdomain"` } +// NewCollection A collection of instances +type NewCollection struct { + // DisplayName A user-friendly name for the collection + DisplayName *string `json:"displayName,omitempty"` + + // Slug A lowercase name identifying the collection. + Slug string `json:"slug"` +} + // NewGrant The body of a request to add a grant to a group. type NewGrant struct { // GroupID A UUID identifying the group this grant is attached to @@ -382,15 +636,6 @@ type NewGrant struct { Value *string `json:"value,omitempty"` } -// NewInventory A collection of items -type NewInventory struct { - // DisplayName A user-friendly name for the inventory - DisplayName *string `json:"displayName,omitempty"` - - // Slug A lowercase name identifying the inventory. - Slug string `json:"slug"` -} - // NewTag The body of a request to add a tag to a host. type NewTag struct { // Name The key for the host tag @@ -532,15 +777,64 @@ type ProvisionerClaims struct { // ProvisionerOptions Options that apply when issuing certificates with this provisioner type ProvisionerOptions struct { // Ssh Options that apply when issuing SSH certificates - Ssh *SshOptions `json:"ssh,omitempty"` - - // Webhooks Configuration for a webhook to be called when issuing certificates with this provisioner - Webhooks *Webhook `json:"webhooks,omitempty"` + Ssh *SshOptions `json:"ssh,omitempty"` + Webhooks *[]ProvisionerWebhook `json:"webhooks,omitempty"` // X509 Options that apply when issuing x509 certificates X509 *X509Options `json:"x509,omitempty"` } +// ProvisionerWebhook A [webhook](https://smallstep.com/docs/step-ca/webhooks/) to call when a certificate request is being processed. +type ProvisionerWebhook struct { + // BasicAuth Configures provisioner webhook requests to include an Authorization header with these credentials. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. At most one of `bearerToken` and `basicAuth` may be set. + BasicAuth *BasicAuth `json:"basicAuth,omitempty"` + + // BearerToken Webhook requests will include an Authorization header with the token. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. At most one of `bearerToken` and `basicAuth` may be set. + BearerToken *string `json:"bearerToken,omitempty"` + CertType ProvisionerWebhookCertType `json:"certType"` + + // CollectionSlug For HOSTED_ATTESTATION webhooks, the collectionSlug is a reference to the collection that holds the devices that may be issued certificates. This collection must already exist. Required for `HOSTED_ATTESTATION` webhook servers; not allowed for `EXTERNAL`. + CollectionSlug *string `json:"collectionSlug,omitempty"` + + // DisableTLSClientAuth The CA will not send a client certificate when requested by the webhook server. Optional for `EXTERNAL` webhook servers; not allowed with hosted webhook servers. + DisableTLSClientAuth *bool `json:"disableTLSClientAuth,omitempty"` + + // Id UUID identifying this webhook. Generated server-side when the webhook is created. Will be sent to the webhook server in every request in the `X-Smallstep-Webhook-ID` header. + Id *string `json:"id,omitempty"` + + // Kind The webhook kind indicates how and when it is called. + // + // ENRICHING webhooks are called before rendering the certificate template. They have two functions. First, they must allow the certificate request or it will be aborted. Second, they can return additional data to be referenced in the certificate template. The payload sent to the webhook server varies based on whether an X509 or SSH certificate is to be signed and based on the type of provisioner. + Kind ProvisionerWebhookKind `json:"kind"` + + // Name The name of the webhook. For `ENRICHING` webhooks, the returned data can be referenced in the certificate under the path `.Webhooks.<name>`. Must be unique to the provisioner. + Name string `json:"name"` + + // Secret The shared secret used to authenticate the payload sent to the webhook server. Generated server-side. This is returned only for `EXTERNAL` webhook servers and only once, at the time of creation. + Secret *string `json:"secret,omitempty"` + + // ServerType An EXTERNAL webhook server is not operated by Smallstep. The caller must use the returned ID and secret to configure the server. + // + // A HOSTED_ATTESTATION webhook server is hosted by Smallstep and must be used with an `ENRICHING` webhook type and an ACME Attestation provisioner. The webhook server will verify the attested permanent identifier exists as the ID of an instance in the configured collection. The data of the instance in the collection will be added to the template data. + ServerType ProvisionerWebhookServerType `json:"serverType"` + + // Url The URL of the webhook server. Required for `EXTERNAL` webhook servers; read-only for hosted webhook servers. + Url *string `json:"url,omitempty"` +} + +// ProvisionerWebhookCertType defines model for ProvisionerWebhook.CertType. +type ProvisionerWebhookCertType string + +// ProvisionerWebhookKind The webhook kind indicates how and when it is called. +// +// ENRICHING webhooks are called before rendering the certificate template. They have two functions. First, they must allow the certificate request or it will be aborted. Second, they can return additional data to be referenced in the certificate template. The payload sent to the webhook server varies based on whether an X509 or SSH certificate is to be signed and based on the type of provisioner. +type ProvisionerWebhookKind string + +// ProvisionerWebhookServerType An EXTERNAL webhook server is not operated by Smallstep. The caller must use the returned ID and secret to configure the server. +// +// A HOSTED_ATTESTATION webhook server is hosted by Smallstep and must be used with an `ENRICHING` webhook type and an ACME Attestation provisioner. The webhook server will verify the attested permanent identifier exists as the ID of an instance in the configured collection. The data of the instance in the collection will be added to the template data. +type ProvisionerWebhookServerType string + // SshOptions Options that apply when issuing SSH certificates type SshOptions struct { // Template A JSON representation of the SSH certificate to be created. [More info](https://smallstep.com/docs/step-ca/templates/#ssh-templates). @@ -584,27 +878,6 @@ type User struct { PosixUsers *[]PosixUser `json:"posixUsers,omitempty"` } -// Webhook Configuration for a webhook to be called when issuing certificates with this provisioner -type Webhook struct { - // CertType Whether to call this webhook when signing X509 certificates, SSH certificates, or ALL certificates. Default is ALL. - CertType *WebhookCertType `json:"certType,omitempty"` - - // DisableTLSClientAuth The CA will not send a client certificate when requested by the webhook server. - DisableTLSClientAuth *bool `json:"disableTLSClientAuth,omitempty"` - - // Id UUID identifying this webhook. Generated server-side when the webhook is created. - Id *string `json:"id,omitempty"` - - // Name The name of the webhook. - Name *string `json:"name,omitempty"` - - // Url The URL of the webhook server. - Url *string `json:"url,omitempty"` -} - -// WebhookCertType Whether to call this webhook when signing X509 certificates, SSH certificates, or ALL certificates. Default is ALL. -type WebhookCertType string - // X509Issuer A Customized X509 issuer for an authority type X509Issuer struct { // Duration The certificate lifetime. Parsed as a [Golang duration](https://pkg.go.dev/time#ParseDuration). @@ -643,12 +916,21 @@ type X5cProvisioner struct { // Accept defines model for accept. type Accept = string +// AgentConfigurationID defines model for agentConfigurationID. +type AgentConfigurationID = string + // AttestationAuthorityID defines model for attestationAuthorityID. type AttestationAuthorityID = string // AuthorityID defines model for authorityID. type AuthorityID = string +// CollectionSlug defines model for collectionSlug. +type CollectionSlug = string + +// EndpointConfigurationID defines model for endpointConfigurationID. +type EndpointConfigurationID = string + // GrantID defines model for grantID. type GrantID = string @@ -658,11 +940,14 @@ type GroupID = string // HostID defines model for hostID. type HostID = string -// InventorySlug defines model for inventorySlug. -type InventorySlug = string +// InstanceID defines model for instanceID. +type InstanceID = string + +// ManagedConfigurationHostID defines model for managedConfigurationHostID. +type ManagedConfigurationHostID = string -// ItemID defines model for itemID. -type ItemID = string +// ManagedConfigurationID defines model for managedConfigurationID. +type ManagedConfigurationID = string // Pagination defines model for pagination. type Pagination struct { @@ -681,6 +966,9 @@ type ProvisionerNameOrID = string // RequestID defines model for requestID. type RequestID = string +// WebhookNameOrID defines model for webhookNameOrID. +type WebhookNameOrID = string + // N400 defines model for 400. type N400 = Error @@ -702,6 +990,33 @@ type N412 = Error // N500 defines model for 500. type N500 = Error +// PostAgentConfigurationsParams defines parameters for PostAgentConfigurations. +type PostAgentConfigurationsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// DeleteAgentConfigurationParams defines parameters for DeleteAgentConfiguration. +type DeleteAgentConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetAgentConfigurationParams defines parameters for GetAgentConfiguration. +type GetAgentConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + // GetAttestationAuthoritiesParams defines parameters for GetAttestationAuthorities. type GetAttestationAuthoritiesParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. @@ -829,6 +1144,33 @@ type GetProvisionerParams struct { Accept *Accept `json:"Accept,omitempty"` } +// PostWebhooksParams defines parameters for PostWebhooks. +type PostWebhooksParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// DeleteWebhookParams defines parameters for DeleteWebhook. +type DeleteWebhookParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetWebhookParams defines parameters for GetWebhook. +type GetWebhookParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + // PostAuthorityRootJSONBody defines parameters for PostAuthorityRoot. type PostAuthorityRootJSONBody struct { // AdminEmails Users that will have admin access to manage the authority @@ -856,8 +1198,11 @@ type PostAuthorityRootParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGrantsParams defines parameters for GetSshGrants. -type GetSshGrantsParams struct { +// ListCollectionsParams defines parameters for ListCollections. +type ListCollectionsParams struct { + // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` + Pagination *Pagination `json:"pagination,omitempty"` + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -865,8 +1210,8 @@ type GetSshGrantsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PostSshGrantsParams defines parameters for PostSshGrants. -type PostSshGrantsParams struct { +// PostCollectionsParams defines parameters for PostCollections. +type PostCollectionsParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -874,8 +1219,8 @@ type PostSshGrantsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// DeleteSshGrantParams defines parameters for DeleteSshGrant. -type DeleteSshGrantParams struct { +// DeleteCollectionParams defines parameters for DeleteCollection. +type DeleteCollectionParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -883,8 +1228,8 @@ type DeleteSshGrantParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGrantParams defines parameters for GetSshGrant. -type GetSshGrantParams struct { +// GetCollectionParams defines parameters for GetCollection. +type GetCollectionParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -892,11 +1237,8 @@ type GetSshGrantParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGroupsParams defines parameters for GetSshGroups. -type GetSshGroupsParams struct { - // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` - Pagination *Pagination `json:"pagination,omitempty"` - +// DeleteCollectionInstanceParams defines parameters for DeleteCollectionInstance. +type DeleteCollectionInstanceParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -904,8 +1246,8 @@ type GetSshGroupsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshGroupParams defines parameters for GetSshGroup. -type GetSshGroupParams struct { +// GetCollectionInstanceParams defines parameters for GetCollectionInstance. +type GetCollectionInstanceParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -913,17 +1255,13 @@ type GetSshGroupParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshHostsParams defines parameters for GetSshHosts. -type GetSshHostsParams struct { - // Active If unset or set to true the results will only include active hosts. If set to false the results will include both active and inactive hosts. - Active *bool `form:"active,omitempty" json:"active,omitempty"` - - // Bastion Filter (non-)bastion hosts. If unset the results will include both bastion and non-bastion hosts. If set to true the results will include only bastion hosts and if set to false the results will include only non-bastion hosts. - Bastion *bool `form:"bastion,omitempty" json:"bastion,omitempty"` - - // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` - Pagination *Pagination `json:"pagination,omitempty"` +// PutCollectionInstanceJSONBody defines parameters for PutCollectionInstance. +type PutCollectionInstanceJSONBody struct { + Data interface{} `json:"data"` +} +// PutCollectionInstanceParams defines parameters for PutCollectionInstance. +type PutCollectionInstanceParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -931,8 +1269,8 @@ type GetSshHostsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetSshHostParams defines parameters for GetSshHost. -type GetSshHostParams struct { +// GetCollectionInstanceDataParams defines parameters for GetCollectionInstanceData. +type GetCollectionInstanceDataParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -940,8 +1278,11 @@ type GetSshHostParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PostHostsHostIDTagsParams defines parameters for PostHostsHostIDTags. -type PostHostsHostIDTagsParams struct { +// PutCollectionInstanceDataJSONBody defines parameters for PutCollectionInstanceData. +type PutCollectionInstanceDataJSONBody = interface{} + +// PutCollectionInstanceDataParams defines parameters for PutCollectionInstanceData. +type PutCollectionInstanceDataParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -949,8 +1290,11 @@ type PostHostsHostIDTagsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// UnregisterSshHostParams defines parameters for UnregisterSshHost. -type UnregisterSshHostParams struct { +// ListCollectionInstancesParams defines parameters for ListCollectionInstances. +type ListCollectionInstancesParams struct { + // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` + Pagination *Pagination `json:"pagination,omitempty"` + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -958,11 +1302,35 @@ type UnregisterSshHostParams struct { Accept *Accept `json:"Accept,omitempty"` } -// ListInventoriesParams defines parameters for ListInventories. -type ListInventoriesParams struct { - // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` - Pagination *Pagination `json:"pagination,omitempty"` +// PostEndpointConfigurationsParams defines parameters for PostEndpointConfigurations. +type PostEndpointConfigurationsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// DeleteEndpointConfigurationParams defines parameters for DeleteEndpointConfiguration. +type DeleteEndpointConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetEndpointConfigurationParams defines parameters for GetEndpointConfiguration. +type GetEndpointConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} +// GetSshGrantsParams defines parameters for GetSshGrants. +type GetSshGrantsParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -970,8 +1338,8 @@ type ListInventoriesParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PostInventoriesParams defines parameters for PostInventories. -type PostInventoriesParams struct { +// PostSshGrantsParams defines parameters for PostSshGrants. +type PostSshGrantsParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -979,8 +1347,8 @@ type PostInventoriesParams struct { Accept *Accept `json:"Accept,omitempty"` } -// DeleteInventoryParams defines parameters for DeleteInventory. -type DeleteInventoryParams struct { +// DeleteSshGrantParams defines parameters for DeleteSshGrant. +type DeleteSshGrantParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -988,8 +1356,8 @@ type DeleteInventoryParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetInventoryParams defines parameters for GetInventory. -type GetInventoryParams struct { +// GetSshGrantParams defines parameters for GetSshGrant. +type GetSshGrantParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -997,8 +1365,8 @@ type GetInventoryParams struct { Accept *Accept `json:"Accept,omitempty"` } -// ListInventoryItemsParams defines parameters for ListInventoryItems. -type ListInventoryItemsParams struct { +// GetSshGroupsParams defines parameters for GetSshGroups. +type GetSshGroupsParams struct { // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` Pagination *Pagination `json:"pagination,omitempty"` @@ -1009,8 +1377,26 @@ type ListInventoryItemsParams struct { Accept *Accept `json:"Accept,omitempty"` } -// DeleteInventoryItemParams defines parameters for DeleteInventoryItem. -type DeleteInventoryItemParams struct { +// GetSshGroupParams defines parameters for GetSshGroup. +type GetSshGroupParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// GetSshHostsParams defines parameters for GetSshHosts. +type GetSshHostsParams struct { + // Active If unset or set to true the results will only include active hosts. If set to false the results will include both active and inactive hosts. + Active *bool `form:"active,omitempty" json:"active,omitempty"` + + // Bastion Filter (non-)bastion hosts. If unset the results will include both bastion and non-bastion hosts. If set to true the results will include only bastion hosts and if set to false the results will include only non-bastion hosts. + Bastion *bool `form:"bastion,omitempty" json:"bastion,omitempty"` + + // Pagination Paginate over a list of objects. Example: `?pagination[first]=30&pagination[after]=MTIzNA==`, which after encoding would be `?pagination%5Bfirst%5D=30&pagination%5Bafter%5D=MTIzNA==` + Pagination *Pagination `json:"pagination,omitempty"` + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1018,8 +1404,8 @@ type DeleteInventoryItemParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetInventoryItemParams defines parameters for GetInventoryItem. -type GetInventoryItemParams struct { +// GetSshHostParams defines parameters for GetSshHost. +type GetSshHostParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1027,13 +1413,35 @@ type GetInventoryItemParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PutInventoryItemJSONBody defines parameters for PutInventoryItem. -type PutInventoryItemJSONBody struct { - Data interface{} `json:"data"` +// PostHostsHostIDTagsParams defines parameters for PostHostsHostIDTags. +type PostHostsHostIDTagsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// UnregisterSshHostParams defines parameters for UnregisterSshHost. +type UnregisterSshHostParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} + +// PostManagedConfigurationsParams defines parameters for PostManagedConfigurations. +type PostManagedConfigurationsParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` } -// PutInventoryItemParams defines parameters for PutInventoryItem. -type PutInventoryItemParams struct { +// DeleteManagedConfigurationHostIdParams defines parameters for DeleteManagedConfigurationHostId. +type DeleteManagedConfigurationHostIdParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1041,8 +1449,8 @@ type PutInventoryItemParams struct { Accept *Accept `json:"Accept,omitempty"` } -// GetInventoryItemDataParams defines parameters for GetInventoryItemData. -type GetInventoryItemDataParams struct { +// GetManagedConfigurationHostIdParams defines parameters for GetManagedConfigurationHostId. +type GetManagedConfigurationHostIdParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1050,11 +1458,17 @@ type GetInventoryItemDataParams struct { Accept *Accept `json:"Accept,omitempty"` } -// PutInventoryItemDataJSONBody defines parameters for PutInventoryItemData. -type PutInventoryItemDataJSONBody = interface{} +// DeleteManagedConfigurationParams defines parameters for DeleteManagedConfiguration. +type DeleteManagedConfigurationParams struct { + // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. + XRequestId *RequestID `json:"X-Request-Id,omitempty"` + + // Accept The content type the client is willing to accept. Also includes API version. + Accept *Accept `json:"Accept,omitempty"` +} -// PutInventoryItemDataParams defines parameters for PutInventoryItemData. -type PutInventoryItemDataParams struct { +// GetManagedConfigurationParams defines parameters for GetManagedConfiguration. +type GetManagedConfigurationParams struct { // XRequestId A request ID provided by the client. If not provided, the server will generate one. Will be reflected in responses. XRequestId *RequestID `json:"X-Request-Id,omitempty"` @@ -1086,6 +1500,9 @@ type GetSshUsersParams struct { Accept *Accept `json:"Accept,omitempty"` } +// PostAgentConfigurationsJSONRequestBody defines body for PostAgentConfigurations for application/json ContentType. +type PostAgentConfigurationsJSONRequestBody = AgentConfiguration + // PostAttestationAuthoritiesJSONRequestBody defines body for PostAttestationAuthorities for application/json ContentType. type PostAttestationAuthoritiesJSONRequestBody = AttestationAuthority @@ -1101,23 +1518,32 @@ type PostAuthoritiesCsrJSONRequestBody = NewAuthorityCsr // PostAuthorityProvisionersJSONRequestBody defines body for PostAuthorityProvisioners for application/json ContentType. type PostAuthorityProvisionersJSONRequestBody = Provisioner +// PostWebhooksJSONRequestBody defines body for PostWebhooks for application/json ContentType. +type PostWebhooksJSONRequestBody = ProvisionerWebhook + // PostAuthorityRootJSONRequestBody defines body for PostAuthorityRoot for application/json ContentType. type PostAuthorityRootJSONRequestBody PostAuthorityRootJSONBody +// PostCollectionsJSONRequestBody defines body for PostCollections for application/json ContentType. +type PostCollectionsJSONRequestBody = NewCollection + +// PutCollectionInstanceJSONRequestBody defines body for PutCollectionInstance for application/json ContentType. +type PutCollectionInstanceJSONRequestBody PutCollectionInstanceJSONBody + +// PutCollectionInstanceDataJSONRequestBody defines body for PutCollectionInstanceData for application/json ContentType. +type PutCollectionInstanceDataJSONRequestBody = PutCollectionInstanceDataJSONBody + +// PostEndpointConfigurationsJSONRequestBody defines body for PostEndpointConfigurations for application/json ContentType. +type PostEndpointConfigurationsJSONRequestBody = EndpointConfiguration + // PostSshGrantsJSONRequestBody defines body for PostSshGrants for application/json ContentType. type PostSshGrantsJSONRequestBody = NewGrant // PostHostsHostIDTagsJSONRequestBody defines body for PostHostsHostIDTags for application/json ContentType. type PostHostsHostIDTagsJSONRequestBody = NewTag -// PostInventoriesJSONRequestBody defines body for PostInventories for application/json ContentType. -type PostInventoriesJSONRequestBody = NewInventory - -// PutInventoryItemJSONRequestBody defines body for PutInventoryItem for application/json ContentType. -type PutInventoryItemJSONRequestBody PutInventoryItemJSONBody - -// PutInventoryItemDataJSONRequestBody defines body for PutInventoryItemData for application/json ContentType. -type PutInventoryItemDataJSONRequestBody = PutInventoryItemDataJSONBody +// PostManagedConfigurationsJSONRequestBody defines body for PostManagedConfigurations for application/json ContentType. +type PostManagedConfigurationsJSONRequestBody = ManagedConfiguration // AsOidcProvisioner returns the union data inside the Provisioner as a OidcProvisioner func (t Provisioner) AsOidcProvisioner() (OidcProvisioner, error) { @@ -1362,6 +1788,15 @@ func (t *Provisioner) UnmarshalJSON(b []byte) error { // ServerInterface represents all server handlers. type ServerInterface interface { + // Create an Agent Configuration + // (POST /agent-configurations) + PostAgentConfigurations(w http.ResponseWriter, r *http.Request, params PostAgentConfigurationsParams) + // Delete Agent Configuration + // (DELETE /agent-configurations/{agentConfigurationID}) + DeleteAgentConfiguration(w http.ResponseWriter, r *http.Request, agentConfigurationID AgentConfigurationID, params DeleteAgentConfigurationParams) + // Get an Agent Configuration + // (GET /agent-configurations/{agentConfigurationID}) + GetAgentConfiguration(w http.ResponseWriter, r *http.Request, agentConfigurationID AgentConfigurationID, params GetAgentConfigurationParams) // List Attestation Authorities // (GET /attestation-authorities) GetAttestationAuthorities(w http.ResponseWriter, r *http.Request, params GetAttestationAuthoritiesParams) @@ -1404,9 +1839,57 @@ type ServerInterface interface { // Get Provisioner // (GET /authorities/{authorityID}/provisioners/{provisionerNameOrID}) GetProvisioner(w http.ResponseWriter, r *http.Request, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params GetProvisionerParams) + // Create Provisioner Webhook + // (POST /authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks) + PostWebhooks(w http.ResponseWriter, r *http.Request, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, params PostWebhooksParams) + // Delete Webhook + // (DELETE /authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks/{webhookNameOrID}) + DeleteWebhook(w http.ResponseWriter, r *http.Request, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params DeleteWebhookParams) + // Get Provisioner Webhook + // (GET /authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks/{webhookNameOrID}) + GetWebhook(w http.ResponseWriter, r *http.Request, authorityID AuthorityID, provisionerNameOrID ProvisionerNameOrID, webhookNameOrID WebhookNameOrID, params GetWebhookParams) // Post Authority External Root // (POST /authorities/{authorityID}/root) PostAuthorityRoot(w http.ResponseWriter, r *http.Request, authorityID AuthorityID, params PostAuthorityRootParams) + // List Collections + // (GET /collections) + ListCollections(w http.ResponseWriter, r *http.Request, params ListCollectionsParams) + // Create a Collection + // (POST /collections) + PostCollections(w http.ResponseWriter, r *http.Request, params PostCollectionsParams) + // Delete Collection + // (DELETE /collections/{collectionSlug}) + DeleteCollection(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, params DeleteCollectionParams) + // Get Collection + // (GET /collections/{collectionSlug}) + GetCollection(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, params GetCollectionParams) + // Delete Collection Instance + // (DELETE /collections/{collectionSlug}/instances/{instanceID}) + DeleteCollectionInstance(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, instanceID InstanceID, params DeleteCollectionInstanceParams) + // Get Collection Instance + // (GET /collections/{collectionSlug}/instances/{instanceID}) + GetCollectionInstance(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, instanceID InstanceID, params GetCollectionInstanceParams) + // Save Collection Instance + // (PUT /collections/{collectionSlug}/instances/{instanceID}) + PutCollectionInstance(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, instanceID InstanceID, params PutCollectionInstanceParams) + // Get Collection Instance Data + // (GET /collections/{collectionSlug}/instances/{instanceID}/data) + GetCollectionInstanceData(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, instanceID InstanceID, params GetCollectionInstanceDataParams) + // Save Collection Instance Data + // (PUT /collections/{collectionSlug}/instances/{instanceID}/data) + PutCollectionInstanceData(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, instanceID InstanceID, params PutCollectionInstanceDataParams) + // List Collection Instances + // (GET /collections/{collectionSlug}/items) + ListCollectionInstances(w http.ResponseWriter, r *http.Request, collectionSlug CollectionSlug, params ListCollectionInstancesParams) + // Create an Endpoint Configuration + // (POST /endpoint-configurations) + PostEndpointConfigurations(w http.ResponseWriter, r *http.Request, params PostEndpointConfigurationsParams) + // Delete Endpoint Configuration + // (DELETE /endpoint-configurations/{endpointConfigurationID}) + DeleteEndpointConfiguration(w http.ResponseWriter, r *http.Request, endpointConfigurationID EndpointConfigurationID, params DeleteEndpointConfigurationParams) + // Get an Endpoint Configuration + // (GET /endpoint-configurations/{endpointConfigurationID}) + GetEndpointConfiguration(w http.ResponseWriter, r *http.Request, endpointConfigurationID EndpointConfigurationID, params GetEndpointConfigurationParams) // Get SSH Grants // (GET /grants) GetSshGrants(w http.ResponseWriter, r *http.Request, params GetSshGrantsParams) @@ -1437,36 +1920,21 @@ type ServerInterface interface { // Unregister SSH Host // (POST /hosts/{hostID}/unregister) UnregisterSshHost(w http.ResponseWriter, r *http.Request, hostID HostID, params UnregisterSshHostParams) - // List Inventories - // (GET /inventories) - ListInventories(w http.ResponseWriter, r *http.Request, params ListInventoriesParams) - // Create an Inventory - // (POST /inventories) - PostInventories(w http.ResponseWriter, r *http.Request, params PostInventoriesParams) - // Delete Inventory - // (DELETE /inventories/{inventorySlug}) - DeleteInventory(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, params DeleteInventoryParams) - // Get Inventory - // (GET /inventories/{inventorySlug}) - GetInventory(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, params GetInventoryParams) - // List Inventory Items - // (GET /inventories/{inventorySlug}/items) - ListInventoryItems(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, params ListInventoryItemsParams) - // Delete Inventory Item - // (DELETE /inventories/{inventorySlug}/items/{itemID}) - DeleteInventoryItem(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, itemID ItemID, params DeleteInventoryItemParams) - // Get Inventory Item - // (GET /inventories/{inventorySlug}/items/{itemID}) - GetInventoryItem(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, itemID ItemID, params GetInventoryItemParams) - // Save Inventory Item - // (PUT /inventories/{inventorySlug}/items/{itemID}) - PutInventoryItem(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, itemID ItemID, params PutInventoryItemParams) - // Get Inventory Item Data - // (GET /inventories/{inventorySlug}/items/{itemID}/data) - GetInventoryItemData(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, itemID ItemID, params GetInventoryItemDataParams) - // Save Inventory Item Data - // (PUT /inventories/{inventorySlug}/items/{itemID}/data) - PutInventoryItemData(w http.ResponseWriter, r *http.Request, inventorySlug InventorySlug, itemID ItemID, params PutInventoryItemDataParams) + // Create a Managed Configuration + // (POST /managed-configurations) + PostManagedConfigurations(w http.ResponseWriter, r *http.Request, params PostManagedConfigurationsParams) + // Delete Managed Configuration By Host ID + // (DELETE /managed-configurations/host/{managedConfigurationHostID}) + DeleteManagedConfigurationHostId(w http.ResponseWriter, r *http.Request, managedConfigurationHostID ManagedConfigurationHostID, params DeleteManagedConfigurationHostIdParams) + // Get a Managed Configuration By Host ID + // (GET /managed-configurations/host/{managedConfigurationHostID}) + GetManagedConfigurationHostId(w http.ResponseWriter, r *http.Request, managedConfigurationHostID ManagedConfigurationHostID, params GetManagedConfigurationHostIdParams) + // Delete Managed Configuration + // (DELETE /managed-configurations/{managedConfigurationID}) + DeleteManagedConfiguration(w http.ResponseWriter, r *http.Request, managedConfigurationID ManagedConfigurationID, params DeleteManagedConfigurationParams) + // Get a Managed Configuration + // (GET /managed-configurations/{managedConfigurationID}) + GetManagedConfiguration(w http.ResponseWriter, r *http.Request, managedConfigurationID ManagedConfigurationID, params GetManagedConfigurationParams) // Get SSH Host Tags // (GET /tags) GetSshHostTags(w http.ResponseWriter, r *http.Request, params GetSshHostTagsParams) @@ -1484,8 +1952,8 @@ type ServerInterfaceWrapper struct { type MiddlewareFunc func(http.Handler) http.Handler -// GetAttestationAuthorities operation middleware -func (siw *ServerInterfaceWrapper) GetAttestationAuthorities(w http.ResponseWriter, r *http.Request) { +// PostAgentConfigurations operation middleware +func (siw *ServerInterfaceWrapper) PostAgentConfigurations(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error @@ -1493,7 +1961,7 @@ func (siw *ServerInterfaceWrapper) GetAttestationAuthorities(w http.ResponseWrit ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetAttestationAuthoritiesParams + var params PostAgentConfigurationsParams headers := r.Header @@ -1536,7 +2004,7 @@ func (siw *ServerInterfaceWrapper) GetAttestationAuthorities(w http.ResponseWrit } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetAttestationAuthorities(w, r, params) + siw.Handler.PostAgentConfigurations(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1546,16 +2014,25 @@ func (siw *ServerInterfaceWrapper) GetAttestationAuthorities(w http.ResponseWrit handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostAttestationAuthorities operation middleware -func (siw *ServerInterfaceWrapper) PostAttestationAuthorities(w http.ResponseWriter, r *http.Request) { +// DeleteAgentConfiguration operation middleware +func (siw *ServerInterfaceWrapper) DeleteAgentConfiguration(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error + // ------------- Path parameter "agentConfigurationID" ------------- + var agentConfigurationID AgentConfigurationID + + err = runtime.BindStyledParameterWithLocation("simple", false, "agentConfigurationID", runtime.ParamLocationPath, chi.URLParam(r, "agentConfigurationID"), &agentConfigurationID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "agentConfigurationID", Err: err}) + return + } + ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostAttestationAuthoritiesParams + var params DeleteAgentConfigurationParams headers := r.Header @@ -1598,7 +2075,7 @@ func (siw *ServerInterfaceWrapper) PostAttestationAuthorities(w http.ResponseWri } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostAttestationAuthorities(w, r, params) + siw.Handler.DeleteAgentConfiguration(w, r, agentConfigurationID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1608,25 +2085,1018 @@ func (siw *ServerInterfaceWrapper) PostAttestationAuthorities(w http.ResponseWri handler.ServeHTTP(w, r.WithContext(ctx)) } -// DeleteAttestationAuthority operation middleware -func (siw *ServerInterfaceWrapper) DeleteAttestationAuthority(w http.ResponseWriter, r *http.Request) { +// GetAgentConfiguration operation middleware +func (siw *ServerInterfaceWrapper) GetAgentConfiguration(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "agentConfigurationID" ------------- + var agentConfigurationID AgentConfigurationID + + err = runtime.BindStyledParameterWithLocation("simple", false, "agentConfigurationID", runtime.ParamLocationPath, chi.URLParam(r, "agentConfigurationID"), &agentConfigurationID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "agentConfigurationID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetAgentConfigurationParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetAgentConfiguration(w, r, agentConfigurationID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetAttestationAuthorities operation middleware +func (siw *ServerInterfaceWrapper) GetAttestationAuthorities(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetAttestationAuthoritiesParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetAttestationAuthorities(w, r, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAttestationAuthorities operation middleware +func (siw *ServerInterfaceWrapper) PostAttestationAuthorities(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "attestationAuthorityID" ------------- - var attestationAuthorityID AttestationAuthorityID + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params PostAttestationAuthoritiesParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAttestationAuthorities(w, r, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteAttestationAuthority operation middleware +func (siw *ServerInterfaceWrapper) DeleteAttestationAuthority(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "attestationAuthorityID" ------------- + var attestationAuthorityID AttestationAuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, chi.URLParam(r, "attestationAuthorityID"), &attestationAuthorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "attestationAuthorityID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteAttestationAuthorityParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteAttestationAuthority(w, r, attestationAuthorityID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetAttestationAuthority operation middleware +func (siw *ServerInterfaceWrapper) GetAttestationAuthority(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "attestationAuthorityID" ------------- + var attestationAuthorityID AttestationAuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, chi.URLParam(r, "attestationAuthorityID"), &attestationAuthorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "attestationAuthorityID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetAttestationAuthorityParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetAttestationAuthority(w, r, attestationAuthorityID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAuth operation middleware +func (siw *ServerInterfaceWrapper) PostAuth(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + ctx = context.WithValue(ctx, MtlsScopes, []string{""}) + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAuth(w, r) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetAuthorities operation middleware +func (siw *ServerInterfaceWrapper) GetAuthorities(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetAuthoritiesParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetAuthorities(w, r, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAuthorities operation middleware +func (siw *ServerInterfaceWrapper) PostAuthorities(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params PostAuthoritiesParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAuthorities(w, r, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAuthoritiesCsr operation middleware +func (siw *ServerInterfaceWrapper) PostAuthoritiesCsr(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params PostAuthoritiesCsrParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAuthoritiesCsr(w, r, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteAuthority operation middleware +func (siw *ServerInterfaceWrapper) DeleteAuthority(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteAuthorityParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteAuthority(w, r, authorityID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetAuthority operation middleware +func (siw *ServerInterfaceWrapper) GetAuthority(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetAuthorityParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetAuthority(w, r, authorityID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// ListAuthorityProvisioners operation middleware +func (siw *ServerInterfaceWrapper) ListAuthorityProvisioners(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListAuthorityProvisionersParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ListAuthorityProvisioners(w, r, authorityID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostAuthorityProvisioners operation middleware +func (siw *ServerInterfaceWrapper) PostAuthorityProvisioners(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params PostAuthorityProvisionersParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.PostAuthorityProvisioners(w, r, authorityID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// DeleteProvisioner operation middleware +func (siw *ServerInterfaceWrapper) DeleteProvisioner(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + // ------------- Path parameter "provisionerNameOrID" ------------- + var provisionerNameOrID ProvisionerNameOrID + + err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteProvisionerParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.DeleteProvisioner(w, r, authorityID, provisionerNameOrID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// GetProvisioner operation middleware +func (siw *ServerInterfaceWrapper) GetProvisioner(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + // ------------- Path parameter "provisionerNameOrID" ------------- + var provisionerNameOrID ProvisionerNameOrID + + err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) + return + } + + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetProvisionerParams + + headers := r.Header + + // ------------- Optional header parameter "X-Request-Id" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("X-Request-Id")]; found { + var XRequestId RequestID + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "X-Request-Id", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "X-Request-Id", runtime.ParamLocationHeader, valueList[0], &XRequestId) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "X-Request-Id", Err: err}) + return + } + + params.XRequestId = &XRequestId + + } + + // ------------- Optional header parameter "Accept" ------------- + if valueList, found := headers[http.CanonicalHeaderKey("Accept")]; found { + var Accept Accept + n := len(valueList) + if n != 1 { + siw.ErrorHandlerFunc(w, r, &TooManyValuesForParamError{ParamName: "Accept", Count: n}) + return + } + + err = runtime.BindStyledParameterWithLocation("simple", false, "Accept", runtime.ParamLocationHeader, valueList[0], &Accept) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "Accept", Err: err}) + return + } + + params.Accept = &Accept + + } + + var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetProvisioner(w, r, authorityID, provisionerNameOrID, params) + }) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r.WithContext(ctx)) +} + +// PostWebhooks operation middleware +func (siw *ServerInterfaceWrapper) PostWebhooks(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() + + var err error + + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + // ------------- Path parameter "provisionerNameOrID" ------------- + var provisionerNameOrID ProvisionerNameOrID - err = runtime.BindStyledParameterWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, chi.URLParam(r, "attestationAuthorityID"), &attestationAuthorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "attestationAuthorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params DeleteAttestationAuthorityParams + var params PostWebhooksParams headers := r.Header @@ -1669,7 +3139,7 @@ func (siw *ServerInterfaceWrapper) DeleteAttestationAuthority(w http.ResponseWri } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.DeleteAttestationAuthority(w, r, attestationAuthorityID, params) + siw.Handler.PostWebhooks(w, r, authorityID, provisionerNameOrID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1679,25 +3149,43 @@ func (siw *ServerInterfaceWrapper) DeleteAttestationAuthority(w http.ResponseWri handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetAttestationAuthority operation middleware -func (siw *ServerInterfaceWrapper) GetAttestationAuthority(w http.ResponseWriter, r *http.Request) { +// DeleteWebhook operation middleware +func (siw *ServerInterfaceWrapper) DeleteWebhook(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "attestationAuthorityID" ------------- - var attestationAuthorityID AttestationAuthorityID + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID - err = runtime.BindStyledParameterWithLocation("simple", false, "attestationAuthorityID", runtime.ParamLocationPath, chi.URLParam(r, "attestationAuthorityID"), &attestationAuthorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "attestationAuthorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + + // ------------- Path parameter "provisionerNameOrID" ------------- + var provisionerNameOrID ProvisionerNameOrID + + err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) + return + } + + // ------------- Path parameter "webhookNameOrID" ------------- + var webhookNameOrID WebhookNameOrID + + err = runtime.BindStyledParameterWithLocation("simple", false, "webhookNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "webhookNameOrID"), &webhookNameOrID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "webhookNameOrID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetAttestationAuthorityParams + var params DeleteWebhookParams headers := r.Header @@ -1740,7 +3228,7 @@ func (siw *ServerInterfaceWrapper) GetAttestationAuthority(w http.ResponseWriter } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetAttestationAuthority(w, r, attestationAuthorityID, params) + siw.Handler.DeleteWebhook(w, r, authorityID, provisionerNameOrID, webhookNameOrID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1750,33 +3238,43 @@ func (siw *ServerInterfaceWrapper) GetAttestationAuthority(w http.ResponseWriter handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostAuth operation middleware -func (siw *ServerInterfaceWrapper) PostAuth(w http.ResponseWriter, r *http.Request) { +// GetWebhook operation middleware +func (siw *ServerInterfaceWrapper) GetWebhook(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - ctx = context.WithValue(ctx, MtlsScopes, []string{""}) + var err error - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostAuth(w, r) - }) + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID - for _, middleware := range siw.HandlerMiddlewares { - handler = middleware(handler) + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return } - handler.ServeHTTP(w, r.WithContext(ctx)) -} + // ------------- Path parameter "provisionerNameOrID" ------------- + var provisionerNameOrID ProvisionerNameOrID -// GetAuthorities operation middleware -func (siw *ServerInterfaceWrapper) GetAuthorities(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() + err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) + return + } - var err error + // ------------- Path parameter "webhookNameOrID" ------------- + var webhookNameOrID WebhookNameOrID + + err = runtime.BindStyledParameterWithLocation("simple", false, "webhookNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "webhookNameOrID"), &webhookNameOrID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "webhookNameOrID", Err: err}) + return + } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetAuthoritiesParams + var params GetWebhookParams headers := r.Header @@ -1819,7 +3317,7 @@ func (siw *ServerInterfaceWrapper) GetAuthorities(w http.ResponseWriter, r *http } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetAuthorities(w, r, params) + siw.Handler.GetWebhook(w, r, authorityID, provisionerNameOrID, webhookNameOrID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1829,16 +3327,25 @@ func (siw *ServerInterfaceWrapper) GetAuthorities(w http.ResponseWriter, r *http handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostAuthorities operation middleware -func (siw *ServerInterfaceWrapper) PostAuthorities(w http.ResponseWriter, r *http.Request) { +// PostAuthorityRoot operation middleware +func (siw *ServerInterfaceWrapper) PostAuthorityRoot(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error + // ------------- Path parameter "authorityID" ------------- + var authorityID AuthorityID + + err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + return + } + ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostAuthoritiesParams + var params PostAuthorityRootParams headers := r.Header @@ -1881,7 +3388,7 @@ func (siw *ServerInterfaceWrapper) PostAuthorities(w http.ResponseWriter, r *htt } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostAuthorities(w, r, params) + siw.Handler.PostAuthorityRoot(w, r, authorityID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1891,8 +3398,8 @@ func (siw *ServerInterfaceWrapper) PostAuthorities(w http.ResponseWriter, r *htt handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostAuthoritiesCsr operation middleware -func (siw *ServerInterfaceWrapper) PostAuthoritiesCsr(w http.ResponseWriter, r *http.Request) { +// ListCollections operation middleware +func (siw *ServerInterfaceWrapper) ListCollections(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error @@ -1900,7 +3407,15 @@ func (siw *ServerInterfaceWrapper) PostAuthoritiesCsr(w http.ResponseWriter, r * ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostAuthoritiesCsrParams + var params ListCollectionsParams + + // ------------- Optional query parameter "pagination" ------------- + + err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) + return + } headers := r.Header @@ -1943,7 +3458,7 @@ func (siw *ServerInterfaceWrapper) PostAuthoritiesCsr(w http.ResponseWriter, r * } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostAuthoritiesCsr(w, r, params) + siw.Handler.ListCollections(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -1953,25 +3468,16 @@ func (siw *ServerInterfaceWrapper) PostAuthoritiesCsr(w http.ResponseWriter, r * handler.ServeHTTP(w, r.WithContext(ctx)) } -// DeleteAuthority operation middleware -func (siw *ServerInterfaceWrapper) DeleteAuthority(w http.ResponseWriter, r *http.Request) { +// PostCollections operation middleware +func (siw *ServerInterfaceWrapper) PostCollections(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID - - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) - return - } - ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params DeleteAuthorityParams + var params PostCollectionsParams headers := r.Header @@ -2014,7 +3520,7 @@ func (siw *ServerInterfaceWrapper) DeleteAuthority(w http.ResponseWriter, r *htt } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.DeleteAuthority(w, r, authorityID, params) + siw.Handler.PostCollections(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2024,25 +3530,25 @@ func (siw *ServerInterfaceWrapper) DeleteAuthority(w http.ResponseWriter, r *htt handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetAuthority operation middleware -func (siw *ServerInterfaceWrapper) GetAuthority(w http.ResponseWriter, r *http.Request) { +// DeleteCollection operation middleware +func (siw *ServerInterfaceWrapper) DeleteCollection(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetAuthorityParams + var params DeleteCollectionParams headers := r.Header @@ -2085,7 +3591,7 @@ func (siw *ServerInterfaceWrapper) GetAuthority(w http.ResponseWriter, r *http.R } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetAuthority(w, r, authorityID, params) + siw.Handler.DeleteCollection(w, r, collectionSlug, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2095,25 +3601,25 @@ func (siw *ServerInterfaceWrapper) GetAuthority(w http.ResponseWriter, r *http.R handler.ServeHTTP(w, r.WithContext(ctx)) } -// ListAuthorityProvisioners operation middleware -func (siw *ServerInterfaceWrapper) ListAuthorityProvisioners(w http.ResponseWriter, r *http.Request) { +// GetCollection operation middleware +func (siw *ServerInterfaceWrapper) GetCollection(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params ListAuthorityProvisionersParams + var params GetCollectionParams headers := r.Header @@ -2156,7 +3662,7 @@ func (siw *ServerInterfaceWrapper) ListAuthorityProvisioners(w http.ResponseWrit } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.ListAuthorityProvisioners(w, r, authorityID, params) + siw.Handler.GetCollection(w, r, collectionSlug, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2166,25 +3672,34 @@ func (siw *ServerInterfaceWrapper) ListAuthorityProvisioners(w http.ResponseWrit handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostAuthorityProvisioners operation middleware -func (siw *ServerInterfaceWrapper) PostAuthorityProvisioners(w http.ResponseWriter, r *http.Request) { +// DeleteCollectionInstance operation middleware +func (siw *ServerInterfaceWrapper) DeleteCollectionInstance(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) + return + } + + // ------------- Path parameter "instanceID" ------------- + var instanceID InstanceID + + err = runtime.BindStyledParameterWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, chi.URLParam(r, "instanceID"), &instanceID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "instanceID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostAuthorityProvisionersParams + var params DeleteCollectionInstanceParams headers := r.Header @@ -2227,7 +3742,7 @@ func (siw *ServerInterfaceWrapper) PostAuthorityProvisioners(w http.ResponseWrit } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostAuthorityProvisioners(w, r, authorityID, params) + siw.Handler.DeleteCollectionInstance(w, r, collectionSlug, instanceID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2237,34 +3752,34 @@ func (siw *ServerInterfaceWrapper) PostAuthorityProvisioners(w http.ResponseWrit handler.ServeHTTP(w, r.WithContext(ctx)) } -// DeleteProvisioner operation middleware -func (siw *ServerInterfaceWrapper) DeleteProvisioner(w http.ResponseWriter, r *http.Request) { +// GetCollectionInstance operation middleware +func (siw *ServerInterfaceWrapper) GetCollectionInstance(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) return } - // ------------- Path parameter "provisionerNameOrID" ------------- - var provisionerNameOrID ProvisionerNameOrID + // ------------- Path parameter "instanceID" ------------- + var instanceID InstanceID - err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) + err = runtime.BindStyledParameterWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, chi.URLParam(r, "instanceID"), &instanceID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "instanceID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params DeleteProvisionerParams + var params GetCollectionInstanceParams headers := r.Header @@ -2307,7 +3822,7 @@ func (siw *ServerInterfaceWrapper) DeleteProvisioner(w http.ResponseWriter, r *h } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.DeleteProvisioner(w, r, authorityID, provisionerNameOrID, params) + siw.Handler.GetCollectionInstance(w, r, collectionSlug, instanceID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2317,34 +3832,34 @@ func (siw *ServerInterfaceWrapper) DeleteProvisioner(w http.ResponseWriter, r *h handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetProvisioner operation middleware -func (siw *ServerInterfaceWrapper) GetProvisioner(w http.ResponseWriter, r *http.Request) { +// PutCollectionInstance operation middleware +func (siw *ServerInterfaceWrapper) PutCollectionInstance(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) return } - // ------------- Path parameter "provisionerNameOrID" ------------- - var provisionerNameOrID ProvisionerNameOrID + // ------------- Path parameter "instanceID" ------------- + var instanceID InstanceID - err = runtime.BindStyledParameterWithLocation("simple", false, "provisionerNameOrID", runtime.ParamLocationPath, chi.URLParam(r, "provisionerNameOrID"), &provisionerNameOrID) + err = runtime.BindStyledParameterWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, chi.URLParam(r, "instanceID"), &instanceID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "provisionerNameOrID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "instanceID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetProvisionerParams + var params PutCollectionInstanceParams headers := r.Header @@ -2387,7 +3902,7 @@ func (siw *ServerInterfaceWrapper) GetProvisioner(w http.ResponseWriter, r *http } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetProvisioner(w, r, authorityID, provisionerNameOrID, params) + siw.Handler.PutCollectionInstance(w, r, collectionSlug, instanceID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2397,25 +3912,34 @@ func (siw *ServerInterfaceWrapper) GetProvisioner(w http.ResponseWriter, r *http handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostAuthorityRoot operation middleware -func (siw *ServerInterfaceWrapper) PostAuthorityRoot(w http.ResponseWriter, r *http.Request) { +// GetCollectionInstanceData operation middleware +func (siw *ServerInterfaceWrapper) GetCollectionInstanceData(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "authorityID" ------------- - var authorityID AuthorityID + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug - err = runtime.BindStyledParameterWithLocation("simple", false, "authorityID", runtime.ParamLocationPath, chi.URLParam(r, "authorityID"), &authorityID) + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "authorityID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) + return + } + + // ------------- Path parameter "instanceID" ------------- + var instanceID InstanceID + + err = runtime.BindStyledParameterWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, chi.URLParam(r, "instanceID"), &instanceID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "instanceID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostAuthorityRootParams + var params GetCollectionInstanceDataParams headers := r.Header @@ -2458,7 +3982,7 @@ func (siw *ServerInterfaceWrapper) PostAuthorityRoot(w http.ResponseWriter, r *h } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostAuthorityRoot(w, r, authorityID, params) + siw.Handler.GetCollectionInstanceData(w, r, collectionSlug, instanceID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2468,16 +3992,34 @@ func (siw *ServerInterfaceWrapper) PostAuthorityRoot(w http.ResponseWriter, r *h handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetSshGrants operation middleware -func (siw *ServerInterfaceWrapper) GetSshGrants(w http.ResponseWriter, r *http.Request) { +// PutCollectionInstanceData operation middleware +func (siw *ServerInterfaceWrapper) PutCollectionInstanceData(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug + + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) + return + } + + // ------------- Path parameter "instanceID" ------------- + var instanceID InstanceID + + err = runtime.BindStyledParameterWithLocation("simple", false, "instanceID", runtime.ParamLocationPath, chi.URLParam(r, "instanceID"), &instanceID) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "instanceID", Err: err}) + return + } + ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetSshGrantsParams + var params PutCollectionInstanceDataParams headers := r.Header @@ -2520,7 +4062,7 @@ func (siw *ServerInterfaceWrapper) GetSshGrants(w http.ResponseWriter, r *http.R } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetSshGrants(w, r, params) + siw.Handler.PutCollectionInstanceData(w, r, collectionSlug, instanceID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2530,16 +4072,33 @@ func (siw *ServerInterfaceWrapper) GetSshGrants(w http.ResponseWriter, r *http.R handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostSshGrants operation middleware -func (siw *ServerInterfaceWrapper) PostSshGrants(w http.ResponseWriter, r *http.Request) { +// ListCollectionInstances operation middleware +func (siw *ServerInterfaceWrapper) ListCollectionInstances(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error + // ------------- Path parameter "collectionSlug" ------------- + var collectionSlug CollectionSlug + + err = runtime.BindStyledParameterWithLocation("simple", false, "collectionSlug", runtime.ParamLocationPath, chi.URLParam(r, "collectionSlug"), &collectionSlug) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "collectionSlug", Err: err}) + return + } + ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostSshGrantsParams + var params ListCollectionInstancesParams + + // ------------- Optional query parameter "pagination" ------------- + + err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) + return + } headers := r.Header @@ -2582,7 +4141,7 @@ func (siw *ServerInterfaceWrapper) PostSshGrants(w http.ResponseWriter, r *http. } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostSshGrants(w, r, params) + siw.Handler.ListCollectionInstances(w, r, collectionSlug, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2592,25 +4151,16 @@ func (siw *ServerInterfaceWrapper) PostSshGrants(w http.ResponseWriter, r *http. handler.ServeHTTP(w, r.WithContext(ctx)) } -// DeleteSshGrant operation middleware -func (siw *ServerInterfaceWrapper) DeleteSshGrant(w http.ResponseWriter, r *http.Request) { +// PostEndpointConfigurations operation middleware +func (siw *ServerInterfaceWrapper) PostEndpointConfigurations(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "grantID" ------------- - var grantID GrantID - - err = runtime.BindStyledParameterWithLocation("simple", false, "grantID", runtime.ParamLocationPath, chi.URLParam(r, "grantID"), &grantID) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "grantID", Err: err}) - return - } - ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params DeleteSshGrantParams + var params PostEndpointConfigurationsParams headers := r.Header @@ -2653,7 +4203,7 @@ func (siw *ServerInterfaceWrapper) DeleteSshGrant(w http.ResponseWriter, r *http } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.DeleteSshGrant(w, r, grantID, params) + siw.Handler.PostEndpointConfigurations(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2663,25 +4213,25 @@ func (siw *ServerInterfaceWrapper) DeleteSshGrant(w http.ResponseWriter, r *http handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetSshGrant operation middleware -func (siw *ServerInterfaceWrapper) GetSshGrant(w http.ResponseWriter, r *http.Request) { +// DeleteEndpointConfiguration operation middleware +func (siw *ServerInterfaceWrapper) DeleteEndpointConfiguration(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "grantID" ------------- - var grantID GrantID + // ------------- Path parameter "endpointConfigurationID" ------------- + var endpointConfigurationID EndpointConfigurationID - err = runtime.BindStyledParameterWithLocation("simple", false, "grantID", runtime.ParamLocationPath, chi.URLParam(r, "grantID"), &grantID) + err = runtime.BindStyledParameterWithLocation("simple", false, "endpointConfigurationID", runtime.ParamLocationPath, chi.URLParam(r, "endpointConfigurationID"), &endpointConfigurationID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "grantID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "endpointConfigurationID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetSshGrantParams + var params DeleteEndpointConfigurationParams headers := r.Header @@ -2724,7 +4274,7 @@ func (siw *ServerInterfaceWrapper) GetSshGrant(w http.ResponseWriter, r *http.Re } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetSshGrant(w, r, grantID, params) + siw.Handler.DeleteEndpointConfiguration(w, r, endpointConfigurationID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2734,25 +4284,26 @@ func (siw *ServerInterfaceWrapper) GetSshGrant(w http.ResponseWriter, r *http.Re handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetSshGroups operation middleware -func (siw *ServerInterfaceWrapper) GetSshGroups(w http.ResponseWriter, r *http.Request) { +// GetEndpointConfiguration operation middleware +func (siw *ServerInterfaceWrapper) GetEndpointConfiguration(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - ctx = context.WithValue(ctx, JWTScopes, []string{""}) - - // Parameter object where we will unmarshal all parameters from the context - var params GetSshGroupsParams - - // ------------- Optional query parameter "pagination" ------------- + // ------------- Path parameter "endpointConfigurationID" ------------- + var endpointConfigurationID EndpointConfigurationID - err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) + err = runtime.BindStyledParameterWithLocation("simple", false, "endpointConfigurationID", runtime.ParamLocationPath, chi.URLParam(r, "endpointConfigurationID"), &endpointConfigurationID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "endpointConfigurationID", Err: err}) return } + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetEndpointConfigurationParams + headers := r.Header // ------------- Optional header parameter "X-Request-Id" ------------- @@ -2794,7 +4345,7 @@ func (siw *ServerInterfaceWrapper) GetSshGroups(w http.ResponseWriter, r *http.R } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetSshGroups(w, r, params) + siw.Handler.GetEndpointConfiguration(w, r, endpointConfigurationID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2804,25 +4355,16 @@ func (siw *ServerInterfaceWrapper) GetSshGroups(w http.ResponseWriter, r *http.R handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetSshGroup operation middleware -func (siw *ServerInterfaceWrapper) GetSshGroup(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - - var err error - - // ------------- Path parameter "groupID" ------------- - var groupID GroupID +// GetSshGrants operation middleware +func (siw *ServerInterfaceWrapper) GetSshGrants(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() - err = runtime.BindStyledParameterWithLocation("simple", false, "groupID", runtime.ParamLocationPath, chi.URLParam(r, "groupID"), &groupID) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "groupID", Err: err}) - return - } + var err error ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetSshGroupParams + var params GetSshGrantsParams headers := r.Header @@ -2865,7 +4407,7 @@ func (siw *ServerInterfaceWrapper) GetSshGroup(w http.ResponseWriter, r *http.Re } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetSshGroup(w, r, groupID, params) + siw.Handler.GetSshGrants(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2875,8 +4417,8 @@ func (siw *ServerInterfaceWrapper) GetSshGroup(w http.ResponseWriter, r *http.Re handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetSshHosts operation middleware -func (siw *ServerInterfaceWrapper) GetSshHosts(w http.ResponseWriter, r *http.Request) { +// PostSshGrants operation middleware +func (siw *ServerInterfaceWrapper) PostSshGrants(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error @@ -2884,31 +4426,7 @@ func (siw *ServerInterfaceWrapper) GetSshHosts(w http.ResponseWriter, r *http.Re ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetSshHostsParams - - // ------------- Optional query parameter "active" ------------- - - err = runtime.BindQueryParameter("form", true, false, "active", r.URL.Query(), ¶ms.Active) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "active", Err: err}) - return - } - - // ------------- Optional query parameter "bastion" ------------- - - err = runtime.BindQueryParameter("form", true, false, "bastion", r.URL.Query(), ¶ms.Bastion) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "bastion", Err: err}) - return - } - - // ------------- Optional query parameter "pagination" ------------- - - err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) - return - } + var params PostSshGrantsParams headers := r.Header @@ -2951,7 +4469,7 @@ func (siw *ServerInterfaceWrapper) GetSshHosts(w http.ResponseWriter, r *http.Re } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetSshHosts(w, r, params) + siw.Handler.PostSshGrants(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -2961,25 +4479,25 @@ func (siw *ServerInterfaceWrapper) GetSshHosts(w http.ResponseWriter, r *http.Re handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetSshHost operation middleware -func (siw *ServerInterfaceWrapper) GetSshHost(w http.ResponseWriter, r *http.Request) { +// DeleteSshGrant operation middleware +func (siw *ServerInterfaceWrapper) DeleteSshGrant(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "hostID" ------------- - var hostID HostID + // ------------- Path parameter "grantID" ------------- + var grantID GrantID - err = runtime.BindStyledParameterWithLocation("simple", false, "hostID", runtime.ParamLocationPath, chi.URLParam(r, "hostID"), &hostID) + err = runtime.BindStyledParameterWithLocation("simple", false, "grantID", runtime.ParamLocationPath, chi.URLParam(r, "grantID"), &grantID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "hostID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "grantID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetSshHostParams + var params DeleteSshGrantParams headers := r.Header @@ -3022,7 +4540,7 @@ func (siw *ServerInterfaceWrapper) GetSshHost(w http.ResponseWriter, r *http.Req } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetSshHost(w, r, hostID, params) + siw.Handler.DeleteSshGrant(w, r, grantID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3032,25 +4550,25 @@ func (siw *ServerInterfaceWrapper) GetSshHost(w http.ResponseWriter, r *http.Req handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostHostsHostIDTags operation middleware -func (siw *ServerInterfaceWrapper) PostHostsHostIDTags(w http.ResponseWriter, r *http.Request) { +// GetSshGrant operation middleware +func (siw *ServerInterfaceWrapper) GetSshGrant(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "hostID" ------------- - var hostID HostID + // ------------- Path parameter "grantID" ------------- + var grantID GrantID - err = runtime.BindStyledParameterWithLocation("simple", false, "hostID", runtime.ParamLocationPath, chi.URLParam(r, "hostID"), &hostID) + err = runtime.BindStyledParameterWithLocation("simple", false, "grantID", runtime.ParamLocationPath, chi.URLParam(r, "grantID"), &grantID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "hostID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "grantID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostHostsHostIDTagsParams + var params GetSshGrantParams headers := r.Header @@ -3093,7 +4611,7 @@ func (siw *ServerInterfaceWrapper) PostHostsHostIDTags(w http.ResponseWriter, r } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostHostsHostIDTags(w, r, hostID, params) + siw.Handler.GetSshGrant(w, r, grantID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3103,26 +4621,25 @@ func (siw *ServerInterfaceWrapper) PostHostsHostIDTags(w http.ResponseWriter, r handler.ServeHTTP(w, r.WithContext(ctx)) } -// UnregisterSshHost operation middleware -func (siw *ServerInterfaceWrapper) UnregisterSshHost(w http.ResponseWriter, r *http.Request) { +// GetSshGroups operation middleware +func (siw *ServerInterfaceWrapper) GetSshGroups(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "hostID" ------------- - var hostID HostID + ctx = context.WithValue(ctx, JWTScopes, []string{""}) - err = runtime.BindStyledParameterWithLocation("simple", false, "hostID", runtime.ParamLocationPath, chi.URLParam(r, "hostID"), &hostID) + // Parameter object where we will unmarshal all parameters from the context + var params GetSshGroupsParams + + // ------------- Optional query parameter "pagination" ------------- + + err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "hostID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) return } - ctx = context.WithValue(ctx, JWTScopes, []string{""}) - - // Parameter object where we will unmarshal all parameters from the context - var params UnregisterSshHostParams - headers := r.Header // ------------- Optional header parameter "X-Request-Id" ------------- @@ -3164,7 +4681,7 @@ func (siw *ServerInterfaceWrapper) UnregisterSshHost(w http.ResponseWriter, r *h } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.UnregisterSshHost(w, r, hostID, params) + siw.Handler.GetSshGroups(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3174,25 +4691,26 @@ func (siw *ServerInterfaceWrapper) UnregisterSshHost(w http.ResponseWriter, r *h handler.ServeHTTP(w, r.WithContext(ctx)) } -// ListInventories operation middleware -func (siw *ServerInterfaceWrapper) ListInventories(w http.ResponseWriter, r *http.Request) { +// GetSshGroup operation middleware +func (siw *ServerInterfaceWrapper) GetSshGroup(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - ctx = context.WithValue(ctx, JWTScopes, []string{""}) - - // Parameter object where we will unmarshal all parameters from the context - var params ListInventoriesParams - - // ------------- Optional query parameter "pagination" ------------- + // ------------- Path parameter "groupID" ------------- + var groupID GroupID - err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) + err = runtime.BindStyledParameterWithLocation("simple", false, "groupID", runtime.ParamLocationPath, chi.URLParam(r, "groupID"), &groupID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "groupID", Err: err}) return } + ctx = context.WithValue(ctx, JWTScopes, []string{""}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetSshGroupParams + headers := r.Header // ------------- Optional header parameter "X-Request-Id" ------------- @@ -3234,7 +4752,7 @@ func (siw *ServerInterfaceWrapper) ListInventories(w http.ResponseWriter, r *htt } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.ListInventories(w, r, params) + siw.Handler.GetSshGroup(w, r, groupID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3244,8 +4762,8 @@ func (siw *ServerInterfaceWrapper) ListInventories(w http.ResponseWriter, r *htt handler.ServeHTTP(w, r.WithContext(ctx)) } -// PostInventories operation middleware -func (siw *ServerInterfaceWrapper) PostInventories(w http.ResponseWriter, r *http.Request) { +// GetSshHosts operation middleware +func (siw *ServerInterfaceWrapper) GetSshHosts(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error @@ -3253,7 +4771,31 @@ func (siw *ServerInterfaceWrapper) PostInventories(w http.ResponseWriter, r *htt ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PostInventoriesParams + var params GetSshHostsParams + + // ------------- Optional query parameter "active" ------------- + + err = runtime.BindQueryParameter("form", true, false, "active", r.URL.Query(), ¶ms.Active) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "active", Err: err}) + return + } + + // ------------- Optional query parameter "bastion" ------------- + + err = runtime.BindQueryParameter("form", true, false, "bastion", r.URL.Query(), ¶ms.Bastion) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "bastion", Err: err}) + return + } + + // ------------- Optional query parameter "pagination" ------------- + + err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) + return + } headers := r.Header @@ -3296,7 +4838,7 @@ func (siw *ServerInterfaceWrapper) PostInventories(w http.ResponseWriter, r *htt } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PostInventories(w, r, params) + siw.Handler.GetSshHosts(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3306,25 +4848,25 @@ func (siw *ServerInterfaceWrapper) PostInventories(w http.ResponseWriter, r *htt handler.ServeHTTP(w, r.WithContext(ctx)) } -// DeleteInventory operation middleware -func (siw *ServerInterfaceWrapper) DeleteInventory(w http.ResponseWriter, r *http.Request) { +// GetSshHost operation middleware +func (siw *ServerInterfaceWrapper) GetSshHost(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug + // ------------- Path parameter "hostID" ------------- + var hostID HostID - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) + err = runtime.BindStyledParameterWithLocation("simple", false, "hostID", runtime.ParamLocationPath, chi.URLParam(r, "hostID"), &hostID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "hostID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params DeleteInventoryParams + var params GetSshHostParams headers := r.Header @@ -3367,7 +4909,7 @@ func (siw *ServerInterfaceWrapper) DeleteInventory(w http.ResponseWriter, r *htt } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.DeleteInventory(w, r, inventorySlug, params) + siw.Handler.GetSshHost(w, r, hostID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3377,25 +4919,25 @@ func (siw *ServerInterfaceWrapper) DeleteInventory(w http.ResponseWriter, r *htt handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetInventory operation middleware -func (siw *ServerInterfaceWrapper) GetInventory(w http.ResponseWriter, r *http.Request) { +// PostHostsHostIDTags operation middleware +func (siw *ServerInterfaceWrapper) PostHostsHostIDTags(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug + // ------------- Path parameter "hostID" ------------- + var hostID HostID - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) + err = runtime.BindStyledParameterWithLocation("simple", false, "hostID", runtime.ParamLocationPath, chi.URLParam(r, "hostID"), &hostID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "hostID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetInventoryParams + var params PostHostsHostIDTagsParams headers := r.Header @@ -3438,7 +4980,7 @@ func (siw *ServerInterfaceWrapper) GetInventory(w http.ResponseWriter, r *http.R } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetInventory(w, r, inventorySlug, params) + siw.Handler.PostHostsHostIDTags(w, r, hostID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3448,33 +4990,25 @@ func (siw *ServerInterfaceWrapper) GetInventory(w http.ResponseWriter, r *http.R handler.ServeHTTP(w, r.WithContext(ctx)) } -// ListInventoryItems operation middleware -func (siw *ServerInterfaceWrapper) ListInventoryItems(w http.ResponseWriter, r *http.Request) { +// UnregisterSshHost operation middleware +func (siw *ServerInterfaceWrapper) UnregisterSshHost(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug + // ------------- Path parameter "hostID" ------------- + var hostID HostID - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) + err = runtime.BindStyledParameterWithLocation("simple", false, "hostID", runtime.ParamLocationPath, chi.URLParam(r, "hostID"), &hostID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "hostID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params ListInventoryItemsParams - - // ------------- Optional query parameter "pagination" ------------- - - err = runtime.BindQueryParameter("deepObject", true, false, "pagination", r.URL.Query(), ¶ms.Pagination) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "pagination", Err: err}) - return - } + var params UnregisterSshHostParams headers := r.Header @@ -3517,7 +5051,7 @@ func (siw *ServerInterfaceWrapper) ListInventoryItems(w http.ResponseWriter, r * } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.ListInventoryItems(w, r, inventorySlug, params) + siw.Handler.UnregisterSshHost(w, r, hostID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3527,34 +5061,16 @@ func (siw *ServerInterfaceWrapper) ListInventoryItems(w http.ResponseWriter, r * handler.ServeHTTP(w, r.WithContext(ctx)) } -// DeleteInventoryItem operation middleware -func (siw *ServerInterfaceWrapper) DeleteInventoryItem(w http.ResponseWriter, r *http.Request) { +// PostManagedConfigurations operation middleware +func (siw *ServerInterfaceWrapper) PostManagedConfigurations(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug - - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) - return - } - - // ------------- Path parameter "itemID" ------------- - var itemID ItemID - - err = runtime.BindStyledParameterWithLocation("simple", false, "itemID", runtime.ParamLocationPath, chi.URLParam(r, "itemID"), &itemID) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemID", Err: err}) - return - } - ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params DeleteInventoryItemParams + var params PostManagedConfigurationsParams headers := r.Header @@ -3597,7 +5113,7 @@ func (siw *ServerInterfaceWrapper) DeleteInventoryItem(w http.ResponseWriter, r } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.DeleteInventoryItem(w, r, inventorySlug, itemID, params) + siw.Handler.PostManagedConfigurations(w, r, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3607,34 +5123,25 @@ func (siw *ServerInterfaceWrapper) DeleteInventoryItem(w http.ResponseWriter, r handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetInventoryItem operation middleware -func (siw *ServerInterfaceWrapper) GetInventoryItem(w http.ResponseWriter, r *http.Request) { +// DeleteManagedConfigurationHostId operation middleware +func (siw *ServerInterfaceWrapper) DeleteManagedConfigurationHostId(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug - - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) - return - } - - // ------------- Path parameter "itemID" ------------- - var itemID ItemID + // ------------- Path parameter "managedConfigurationHostID" ------------- + var managedConfigurationHostID ManagedConfigurationHostID - err = runtime.BindStyledParameterWithLocation("simple", false, "itemID", runtime.ParamLocationPath, chi.URLParam(r, "itemID"), &itemID) + err = runtime.BindStyledParameterWithLocation("simple", false, "managedConfigurationHostID", runtime.ParamLocationPath, chi.URLParam(r, "managedConfigurationHostID"), &managedConfigurationHostID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "managedConfigurationHostID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetInventoryItemParams + var params DeleteManagedConfigurationHostIdParams headers := r.Header @@ -3677,7 +5184,7 @@ func (siw *ServerInterfaceWrapper) GetInventoryItem(w http.ResponseWriter, r *ht } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetInventoryItem(w, r, inventorySlug, itemID, params) + siw.Handler.DeleteManagedConfigurationHostId(w, r, managedConfigurationHostID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3687,34 +5194,25 @@ func (siw *ServerInterfaceWrapper) GetInventoryItem(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// PutInventoryItem operation middleware -func (siw *ServerInterfaceWrapper) PutInventoryItem(w http.ResponseWriter, r *http.Request) { +// GetManagedConfigurationHostId operation middleware +func (siw *ServerInterfaceWrapper) GetManagedConfigurationHostId(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug - - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) - return - } - - // ------------- Path parameter "itemID" ------------- - var itemID ItemID + // ------------- Path parameter "managedConfigurationHostID" ------------- + var managedConfigurationHostID ManagedConfigurationHostID - err = runtime.BindStyledParameterWithLocation("simple", false, "itemID", runtime.ParamLocationPath, chi.URLParam(r, "itemID"), &itemID) + err = runtime.BindStyledParameterWithLocation("simple", false, "managedConfigurationHostID", runtime.ParamLocationPath, chi.URLParam(r, "managedConfigurationHostID"), &managedConfigurationHostID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "managedConfigurationHostID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PutInventoryItemParams + var params GetManagedConfigurationHostIdParams headers := r.Header @@ -3757,7 +5255,7 @@ func (siw *ServerInterfaceWrapper) PutInventoryItem(w http.ResponseWriter, r *ht } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PutInventoryItem(w, r, inventorySlug, itemID, params) + siw.Handler.GetManagedConfigurationHostId(w, r, managedConfigurationHostID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3767,34 +5265,25 @@ func (siw *ServerInterfaceWrapper) PutInventoryItem(w http.ResponseWriter, r *ht handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetInventoryItemData operation middleware -func (siw *ServerInterfaceWrapper) GetInventoryItemData(w http.ResponseWriter, r *http.Request) { +// DeleteManagedConfiguration operation middleware +func (siw *ServerInterfaceWrapper) DeleteManagedConfiguration(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug - - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) - return - } - - // ------------- Path parameter "itemID" ------------- - var itemID ItemID + // ------------- Path parameter "managedConfigurationID" ------------- + var managedConfigurationID ManagedConfigurationID - err = runtime.BindStyledParameterWithLocation("simple", false, "itemID", runtime.ParamLocationPath, chi.URLParam(r, "itemID"), &itemID) + err = runtime.BindStyledParameterWithLocation("simple", false, "managedConfigurationID", runtime.ParamLocationPath, chi.URLParam(r, "managedConfigurationID"), &managedConfigurationID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "managedConfigurationID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params GetInventoryItemDataParams + var params DeleteManagedConfigurationParams headers := r.Header @@ -3837,7 +5326,7 @@ func (siw *ServerInterfaceWrapper) GetInventoryItemData(w http.ResponseWriter, r } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetInventoryItemData(w, r, inventorySlug, itemID, params) + siw.Handler.DeleteManagedConfiguration(w, r, managedConfigurationID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -3847,34 +5336,25 @@ func (siw *ServerInterfaceWrapper) GetInventoryItemData(w http.ResponseWriter, r handler.ServeHTTP(w, r.WithContext(ctx)) } -// PutInventoryItemData operation middleware -func (siw *ServerInterfaceWrapper) PutInventoryItemData(w http.ResponseWriter, r *http.Request) { +// GetManagedConfiguration operation middleware +func (siw *ServerInterfaceWrapper) GetManagedConfiguration(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error - // ------------- Path parameter "inventorySlug" ------------- - var inventorySlug InventorySlug - - err = runtime.BindStyledParameterWithLocation("simple", false, "inventorySlug", runtime.ParamLocationPath, chi.URLParam(r, "inventorySlug"), &inventorySlug) - if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "inventorySlug", Err: err}) - return - } - - // ------------- Path parameter "itemID" ------------- - var itemID ItemID + // ------------- Path parameter "managedConfigurationID" ------------- + var managedConfigurationID ManagedConfigurationID - err = runtime.BindStyledParameterWithLocation("simple", false, "itemID", runtime.ParamLocationPath, chi.URLParam(r, "itemID"), &itemID) + err = runtime.BindStyledParameterWithLocation("simple", false, "managedConfigurationID", runtime.ParamLocationPath, chi.URLParam(r, "managedConfigurationID"), &managedConfigurationID) if err != nil { - siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "itemID", Err: err}) + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "managedConfigurationID", Err: err}) return } ctx = context.WithValue(ctx, JWTScopes, []string{""}) // Parameter object where we will unmarshal all parameters from the context - var params PutInventoryItemDataParams + var params GetManagedConfigurationParams headers := r.Header @@ -3917,7 +5397,7 @@ func (siw *ServerInterfaceWrapper) PutInventoryItemData(w http.ResponseWriter, r } var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.PutInventoryItemData(w, r, inventorySlug, itemID, params) + siw.Handler.GetManagedConfiguration(w, r, managedConfigurationID, params) }) for _, middleware := range siw.HandlerMiddlewares { @@ -4180,6 +5660,15 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl ErrorHandlerFunc: options.ErrorHandlerFunc, } + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/agent-configurations", wrapper.PostAgentConfigurations) + }) + r.Group(func(r chi.Router) { + r.Delete(options.BaseURL+"/agent-configurations/{agentConfigurationID}", wrapper.DeleteAgentConfiguration) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/agent-configurations/{agentConfigurationID}", wrapper.GetAgentConfiguration) + }) r.Group(func(r chi.Router) { r.Get(options.BaseURL+"/attestation-authorities", wrapper.GetAttestationAuthorities) }) @@ -4222,68 +5711,101 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl r.Group(func(r chi.Router) { r.Get(options.BaseURL+"/authorities/{authorityID}/provisioners/{provisionerNameOrID}", wrapper.GetProvisioner) }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks", wrapper.PostWebhooks) + }) + r.Group(func(r chi.Router) { + r.Delete(options.BaseURL+"/authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks/{webhookNameOrID}", wrapper.DeleteWebhook) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/authorities/{authorityID}/provisioners/{provisionerNameOrID}/webhooks/{webhookNameOrID}", wrapper.GetWebhook) + }) r.Group(func(r chi.Router) { r.Post(options.BaseURL+"/authorities/{authorityID}/root", wrapper.PostAuthorityRoot) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/grants", wrapper.GetSshGrants) + r.Get(options.BaseURL+"/collections", wrapper.ListCollections) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/grants", wrapper.PostSshGrants) + r.Post(options.BaseURL+"/collections", wrapper.PostCollections) }) r.Group(func(r chi.Router) { - r.Delete(options.BaseURL+"/grants/{grantID}", wrapper.DeleteSshGrant) + r.Delete(options.BaseURL+"/collections/{collectionSlug}", wrapper.DeleteCollection) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/grants/{grantID}", wrapper.GetSshGrant) + r.Get(options.BaseURL+"/collections/{collectionSlug}", wrapper.GetCollection) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/groups", wrapper.GetSshGroups) + r.Delete(options.BaseURL+"/collections/{collectionSlug}/instances/{instanceID}", wrapper.DeleteCollectionInstance) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/groups/{groupID}", wrapper.GetSshGroup) + r.Get(options.BaseURL+"/collections/{collectionSlug}/instances/{instanceID}", wrapper.GetCollectionInstance) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/hosts", wrapper.GetSshHosts) + r.Put(options.BaseURL+"/collections/{collectionSlug}/instances/{instanceID}", wrapper.PutCollectionInstance) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/hosts/{hostID}", wrapper.GetSshHost) + r.Get(options.BaseURL+"/collections/{collectionSlug}/instances/{instanceID}/data", wrapper.GetCollectionInstanceData) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/hosts/{hostID}/tags", wrapper.PostHostsHostIDTags) + r.Put(options.BaseURL+"/collections/{collectionSlug}/instances/{instanceID}/data", wrapper.PutCollectionInstanceData) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/hosts/{hostID}/unregister", wrapper.UnregisterSshHost) + r.Get(options.BaseURL+"/collections/{collectionSlug}/items", wrapper.ListCollectionInstances) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/endpoint-configurations", wrapper.PostEndpointConfigurations) + }) + r.Group(func(r chi.Router) { + r.Delete(options.BaseURL+"/endpoint-configurations/{endpointConfigurationID}", wrapper.DeleteEndpointConfiguration) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/endpoint-configurations/{endpointConfigurationID}", wrapper.GetEndpointConfiguration) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/grants", wrapper.GetSshGrants) + }) + r.Group(func(r chi.Router) { + r.Post(options.BaseURL+"/grants", wrapper.PostSshGrants) + }) + r.Group(func(r chi.Router) { + r.Delete(options.BaseURL+"/grants/{grantID}", wrapper.DeleteSshGrant) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/grants/{grantID}", wrapper.GetSshGrant) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/inventories", wrapper.ListInventories) + r.Get(options.BaseURL+"/groups", wrapper.GetSshGroups) + }) + r.Group(func(r chi.Router) { + r.Get(options.BaseURL+"/groups/{groupID}", wrapper.GetSshGroup) }) r.Group(func(r chi.Router) { - r.Post(options.BaseURL+"/inventories", wrapper.PostInventories) + r.Get(options.BaseURL+"/hosts", wrapper.GetSshHosts) }) r.Group(func(r chi.Router) { - r.Delete(options.BaseURL+"/inventories/{inventorySlug}", wrapper.DeleteInventory) + r.Get(options.BaseURL+"/hosts/{hostID}", wrapper.GetSshHost) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/inventories/{inventorySlug}", wrapper.GetInventory) + r.Post(options.BaseURL+"/hosts/{hostID}/tags", wrapper.PostHostsHostIDTags) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/inventories/{inventorySlug}/items", wrapper.ListInventoryItems) + r.Post(options.BaseURL+"/hosts/{hostID}/unregister", wrapper.UnregisterSshHost) }) r.Group(func(r chi.Router) { - r.Delete(options.BaseURL+"/inventories/{inventorySlug}/items/{itemID}", wrapper.DeleteInventoryItem) + r.Post(options.BaseURL+"/managed-configurations", wrapper.PostManagedConfigurations) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/inventories/{inventorySlug}/items/{itemID}", wrapper.GetInventoryItem) + r.Delete(options.BaseURL+"/managed-configurations/host/{managedConfigurationHostID}", wrapper.DeleteManagedConfigurationHostId) }) r.Group(func(r chi.Router) { - r.Put(options.BaseURL+"/inventories/{inventorySlug}/items/{itemID}", wrapper.PutInventoryItem) + r.Get(options.BaseURL+"/managed-configurations/host/{managedConfigurationHostID}", wrapper.GetManagedConfigurationHostId) }) r.Group(func(r chi.Router) { - r.Get(options.BaseURL+"/inventories/{inventorySlug}/items/{itemID}/data", wrapper.GetInventoryItemData) + r.Delete(options.BaseURL+"/managed-configurations/{managedConfigurationID}", wrapper.DeleteManagedConfiguration) }) r.Group(func(r chi.Router) { - r.Put(options.BaseURL+"/inventories/{inventorySlug}/items/{itemID}/data", wrapper.PutInventoryItemData) + r.Get(options.BaseURL+"/managed-configurations/{managedConfigurationID}", wrapper.GetManagedConfiguration) }) r.Group(func(r chi.Router) { r.Get(options.BaseURL+"/tags", wrapper.GetSshHostTags) @@ -4298,197 +5820,248 @@ func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handl // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "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", - "vb63YgOZ0nIPnx/+XwAAAP//9YhUs7sAAQA=", + "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", + "VQEA", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/internal/provider/collection/data_source.go b/internal/provider/collection/data_source.go new file mode 100644 index 0000000..14f0eda --- /dev/null +++ b/internal/provider/collection/data_source.go @@ -0,0 +1,139 @@ +package collection + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-log/tflog" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +var _ datasource.DataSourceWithConfigure = (*DataSource)(nil) + +func NewDataSource() datasource.DataSource { + return &DataSource{} +} + +// DataSource implements data.smallstep_collection +type DataSource struct { + client *v20230301.Client +} + +func (a *DataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = collectionTypeName +} + +// Configure adds the Smallstep API client to the data source. +func (a *DataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*v20230301.Client) + + if !ok { + resp.Diagnostics.AddError( + "Get Smallstep API client from provider", + fmt.Sprintf("Expected *v20230301.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + a.client = client +} + +func (a *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config Model + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &config)...) + + if resp.Diagnostics.HasError() { + return + } + + httpResp, err := a.client.GetCollection(ctx, config.Slug.ValueString(), &v20230301.GetCollectionParams{}) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to read collection %s: %v", config.Slug.String(), err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusOK { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d reading collection %s: %s", httpResp.StatusCode, config.Slug.String(), utils.APIErrorMsg(httpResp.Body)), + ) + return + } + + collection := &v20230301.Collection{} + if err := json.NewDecoder(httpResp.Body).Decode(collection); err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to unmarshal collection %s: %v", config.Slug.String(), err), + ) + return + } + + remote, d := fromAPI(ctx, collection, req.Config) + resp.Diagnostics.Append(d...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Trace(ctx, fmt.Sprintf("read collection %q data source", config.Slug.String())) + + resp.Diagnostics.Append(resp.State.Set(ctx, &remote)...) +} + +func (d *DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + component, props, err := utils.Describe("collection") + if err != nil { + resp.Diagnostics.AddError( + "Parse Smallstep OpenAPI spec", + err.Error(), + ) + return + } + + resp.Schema = schema.Schema{ + MarkdownDescription: component, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + MarkdownDescription: "Internal use only", + Computed: true, + }, + "slug": schema.StringAttribute{ + MarkdownDescription: props["slug"], + Required: true, + }, + "display_name": schema.StringAttribute{ + MarkdownDescription: props["name"], + Computed: true, + }, + "instance_count": schema.Int64Attribute{ + MarkdownDescription: props["instanceCount"], + Computed: true, + }, + "created_at": schema.StringAttribute{ + MarkdownDescription: props["createdAt"], + Computed: true, + }, + "updated_at": schema.StringAttribute{ + MarkdownDescription: props["updatedAt"], + Computed: true, + }, + }, + } +} diff --git a/internal/provider/collection/model.go b/internal/provider/collection/model.go new file mode 100644 index 0000000..bec011f --- /dev/null +++ b/internal/provider/collection/model.go @@ -0,0 +1,45 @@ +package collection + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +const collectionTypeName = "smallstep_collection" + +type Model struct { + Slug types.String `tfsdk:"slug"` + DisplayName types.String `tfsdk:"display_name"` + InstanceCount types.Int64 `tfsdk:"instance_count"` + CreatedAt types.String `tfsdk:"created_at"` + UpdatedAt types.String `tfsdk:"updated_at"` + // https://developer.hashicorp.com/terraform/plugin/framework/acctests#implement-id-attribute + ID types.String `tfsdk:"id"` +} + +func fromAPI(ctx context.Context, collection *v20230301.Collection, state utils.AttributeGetter) (*Model, diag.Diagnostics) { + var diags diag.Diagnostics + + model := &Model{ + Slug: types.StringValue(collection.Slug), + InstanceCount: types.Int64Value(int64(collection.InstanceCount)), + DisplayName: types.StringValue(collection.DisplayName), + CreatedAt: types.StringValue(collection.CreatedAt.Format(time.RFC3339)), + UpdatedAt: types.StringValue(collection.UpdatedAt.Format(time.RFC3339)), + ID: types.StringValue(collection.Slug), + } + + return model, diags +} + +func toAPI(model *Model) *v20230301.NewCollection { + return &v20230301.NewCollection{ + Slug: model.Slug.ValueString(), + DisplayName: model.DisplayName.ValueStringPointer(), + } +} diff --git a/internal/provider/collection/resource.go b/internal/provider/collection/resource.go new file mode 100644 index 0000000..f695bb9 --- /dev/null +++ b/internal/provider/collection/resource.go @@ -0,0 +1,244 @@ +package collection + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-log/tflog" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +var _ resource.ResourceWithImportState = (*Resource)(nil) + +func NewResource() resource.Resource { + return &Resource{} +} + +// Resource defines the resource implementation. +type Resource struct { + client *v20230301.Client +} + +func (r *Resource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = collectionTypeName +} + +// Configure adds the Smallstep API client to the resource. +func (r *Resource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*v20230301.Client) + + if !ok { + resp.Diagnostics.AddError( + "Get Smallstep API client from provider", + fmt.Sprintf("Expected *v20230301.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + r.client = client +} + +func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + state := &Model{} + + resp.Diagnostics.Append(req.State.Get(ctx, state)...) + + if resp.Diagnostics.HasError() { + return + } + + httpResp, err := r.client.GetCollection(ctx, state.Slug.ValueString(), &v20230301.GetCollectionParams{}) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to read collection %s: %v", state.Slug.String(), err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode == http.StatusNotFound { + resp.State.RemoveResource(ctx) + return + } + + if httpResp.StatusCode != http.StatusOK { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d reading collection %s: %s", httpResp.StatusCode, state.Slug.String(), utils.APIErrorMsg(httpResp.Body)), + ) + return + } + + collection := &v20230301.Collection{} + if err := json.NewDecoder(httpResp.Body).Decode(collection); err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to unmarshal collection %s: %v", state.Slug.String(), err), + ) + return + } + + remote, d := fromAPI(ctx, collection, req.State) + resp.Diagnostics.Append(d...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Trace(ctx, fmt.Sprintf("read collection %q resource", collection.Slug)) + + resp.Diagnostics.Append(resp.State.Set(ctx, &remote)...) +} + +func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + component, props, err := utils.Describe("collection") + if err != nil { + resp.Diagnostics.AddError( + "Parse Smallstep OpenAPI spec", + err.Error(), + ) + return + } + + resp.Schema = schema.Schema{ + MarkdownDescription: component, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + MarkdownDescription: "Internal use only", + Computed: true, + }, + "slug": schema.StringAttribute{ + MarkdownDescription: props["slug"], + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "display_name": schema.StringAttribute{ + MarkdownDescription: props["name"], + Optional: true, + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "instance_count": schema.Int64Attribute{ + MarkdownDescription: props["instanceCount"], + Computed: true, + }, + "created_at": schema.StringAttribute{ + MarkdownDescription: props["createdAt"], + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "updated_at": schema.StringAttribute{ + MarkdownDescription: props["updatedAt"], + Computed: true, + }, + }, + } +} + +func (a *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan Model + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + + if resp.Diagnostics.HasError() { + return + } + + reqBody := toAPI(&plan) + + b, _ := json.Marshal(reqBody) + tflog.Trace(ctx, string(b)) + + httpResp, err := a.client.PostCollections(ctx, &v20230301.PostCollectionsParams{}, *reqBody) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to create collection %q: %v", plan.Slug.String(), err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusCreated { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d creating collection %q: %s", httpResp.StatusCode, plan.Slug.String(), utils.APIErrorMsg(httpResp.Body)), + ) + return + } + + collection := &v20230301.Collection{} + if err := json.NewDecoder(httpResp.Body).Decode(collection); err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to unmarshal collection %q: %v", plan.Slug.ValueString(), err), + ) + return + } + + state, diags := fromAPI(ctx, collection, req.Plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Trace(ctx, fmt.Sprintf("create collection %q resource", plan.Slug.ValueString())) + + resp.Diagnostics.Append(resp.State.Set(ctx, state)...) +} + +func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // Update not supported. All changes require replacement. +} + +func (a *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state Model + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + httpResp, err := a.client.DeleteCollection(ctx, state.Slug.ValueString(), &v20230301.DeleteCollectionParams{}) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to delete collection %s: %v", state.Slug.String(), err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusNoContent { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d deleting collection %s: %s", httpResp.StatusCode, state.Slug.String(), utils.APIErrorMsg(httpResp.Body)), + ) + return + } +} + +func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("slug"), req, resp) +} diff --git a/internal/provider/collection_data_source_test.go b/internal/provider/collection_data_source_test.go new file mode 100644 index 0000000..044aec0 --- /dev/null +++ b/internal/provider/collection_data_source_test.go @@ -0,0 +1,36 @@ +package provider + +import ( + "fmt" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +func TestAccCollectionDataSource(t *testing.T) { + t.Parallel() + collection := utils.NewCollection(t) + config := fmt.Sprintf(` +data "smallstep_collection" "test" { + slug = %q +} +`, collection.Slug) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.smallstep_collection.test", "slug", collection.Slug), + resource.TestCheckResourceAttr("data.smallstep_collection.test", "instance_count", "0"), + resource.TestCheckResourceAttr("data.smallstep_collection.test", "display_name", collection.DisplayName), + resource.TestMatchResourceAttr("data.smallstep_collection.test", "created_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + resource.TestMatchResourceAttr("data.smallstep_collection.test", "updated_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + ), + }, + }, + }) +} diff --git a/internal/provider/collection_instance/data_source.go b/internal/provider/collection_instance/data_source.go new file mode 100644 index 0000000..726c485 --- /dev/null +++ b/internal/provider/collection_instance/data_source.go @@ -0,0 +1,138 @@ +package collection_instance + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-log/tflog" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +var _ datasource.DataSourceWithConfigure = (*DataSource)(nil) + +func NewDataSource() datasource.DataSource { + return &DataSource{} +} + +// DataSource implements data.smallstep_collection +type DataSource struct { + client *v20230301.Client +} + +func (a *DataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = instanceTypeName +} + +// Configure adds the Smallstep API client to the data source. +func (a *DataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*v20230301.Client) + + if !ok { + resp.Diagnostics.AddError( + "Get Smallstep API client from provider", + fmt.Sprintf("Expected *v20230301.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + a.client = client +} + +func (a *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config Model + + // Read Terraform configuration data into the model + resp.Diagnostics.Append(req.Config.Get(ctx, &config)...) + + if resp.Diagnostics.HasError() { + return + } + + slug := config.CollectionSlug.ValueString() + id := config.ID.ValueString() + + httpResp, err := a.client.GetCollectionInstance(ctx, slug, id, &v20230301.GetCollectionInstanceParams{}) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to read collection instance %s/%s: %v", slug, id, err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusOK { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d reading collection instance %s/%s: %s", httpResp.StatusCode, slug, id, utils.APIErrorMsg(httpResp.Body)), + ) + return + } + + instance := &v20230301.CollectionInstance{} + if err := json.NewDecoder(httpResp.Body).Decode(instance); err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to unmarshal collection instance %s/%s: %v", slug, id, err), + ) + return + } + + remote, d := fromAPI(ctx, slug, instance, req.Config) + resp.Diagnostics.Append(d...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Trace(ctx, fmt.Sprintf("read collection instance %s/%s data source", slug, id)) + + resp.Diagnostics.Append(resp.State.Set(ctx, &remote)...) +} + +func (d *DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + component, props, err := utils.Describe("collection-instance") + if err != nil { + resp.Diagnostics.AddError( + "Parse Smallstep OpenAPI spec", + err.Error(), + ) + return + } + + resp.Schema = schema.Schema{ + MarkdownDescription: component, + + Attributes: map[string]schema.Attribute{ + "collection_slug": schema.StringAttribute{ + MarkdownDescription: "The slug of the collection this instance belongs to", + Required: true, + }, + "id": schema.StringAttribute{ + MarkdownDescription: props["id"], + Required: true, + }, + "data": schema.StringAttribute{ + MarkdownDescription: props["data"], + Computed: true, + }, + "created_at": schema.StringAttribute{ + MarkdownDescription: props["createdAt"], + Computed: true, + }, + "updated_at": schema.StringAttribute{ + MarkdownDescription: props["updatedAt"], + Computed: true, + }, + }, + } +} diff --git a/internal/provider/collection_instance/model.go b/internal/provider/collection_instance/model.go new file mode 100644 index 0000000..d1ccf44 --- /dev/null +++ b/internal/provider/collection_instance/model.go @@ -0,0 +1,62 @@ +package collection_instance + +import ( + "context" + "encoding/json" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/types" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +const instanceTypeName = "smallstep_collection_instance" + +type Model struct { + CollectionSlug types.String `tfsdk:"collection_slug"` + ID types.String `tfsdk:"id"` + Data types.String `tfsdk:"data"` + CreatedAt types.String `tfsdk:"created_at"` + UpdatedAt types.String `tfsdk:"updated_at"` +} + +func fromAPI(ctx context.Context, slug string, instance *v20230301.CollectionInstance, state utils.AttributeGetter) (*Model, diag.Diagnostics) { + var diags diag.Diagnostics + + model := &Model{ + CollectionSlug: types.StringValue(slug), + ID: types.StringValue(instance.Id), + CreatedAt: types.StringValue(instance.CreatedAt.Format(time.RFC3339)), + UpdatedAt: types.StringValue(instance.UpdatedAt.Format(time.RFC3339)), + } + + apiDataJSON, err := json.Marshal(instance.Data) + if err != nil { + diags.AddError("Marshal Instance Data", err.Error()) + return nil, diags + } + + dataFromState := types.String{} + d := state.GetAttribute(ctx, path.Root("data"), &dataFromState) + diags = append(diags, d...) + if utils.IsJSONEqual(dataFromState.ValueString(), string(apiDataJSON)) { + model.Data = dataFromState + } else { + model.Data = types.StringValue(string(apiDataJSON)) + } + + return model, diags +} +func toAPI(model *Model) (*v20230301.PutCollectionInstanceJSONRequestBody, diag.Diagnostics) { + var diags diag.Diagnostics + + instance := &v20230301.PutCollectionInstanceJSONRequestBody{} + + if err := json.Unmarshal([]byte(model.Data.ValueString()), &instance.Data); err != nil { + diags.AddError("Parse Instance Data", err.Error()) + } + + return instance, diags +} diff --git a/internal/provider/collection_instance/resource.go b/internal/provider/collection_instance/resource.go new file mode 100644 index 0000000..b7b086f --- /dev/null +++ b/internal/provider/collection_instance/resource.go @@ -0,0 +1,266 @@ +package collection_instance + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-log/tflog" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +var _ resource.ResourceWithImportState = (*Resource)(nil) + +func NewResource() resource.Resource { + return &Resource{} +} + +// Resource defines the resource implementation. +type Resource struct { + client *v20230301.Client +} + +func (r *Resource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = instanceTypeName +} + +// Configure adds the Smallstep API client to the resource. +func (r *Resource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + // Prevent panic if the provider has not been configured. + if req.ProviderData == nil { + return + } + + client, ok := req.ProviderData.(*v20230301.Client) + + if !ok { + resp.Diagnostics.AddError( + "Get Smallstep API client from provider", + fmt.Sprintf("Expected *v20230301.Client, got: %T. Please report this issue to the provider developers.", req.ProviderData), + ) + return + } + + r.client = client +} + +func (r *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + state := &Model{} + + resp.Diagnostics.Append(req.State.Get(ctx, state)...) + + if resp.Diagnostics.HasError() { + return + } + + slug := state.CollectionSlug.ValueString() + id := state.ID.ValueString() + + httpResp, err := r.client.GetCollectionInstance(ctx, slug, id, &v20230301.GetCollectionInstanceParams{}) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to read collection instance %s/%s: %v", slug, id, err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode == http.StatusNotFound { + resp.State.RemoveResource(ctx) + return + } + + if httpResp.StatusCode != http.StatusOK { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d reading collection instance %s/%s: %s", httpResp.StatusCode, slug, id, utils.APIErrorMsg(httpResp.Body)), + ) + return + } + + instance := &v20230301.CollectionInstance{} + if err := json.NewDecoder(httpResp.Body).Decode(instance); err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to unmarshal collection instance %s/%s: %v", slug, id, err), + ) + return + } + + remote, d := fromAPI(ctx, slug, instance, req.State) + if d.HasError() { + resp.Diagnostics.Append(d...) + return + } + + tflog.Trace(ctx, fmt.Sprintf("read collection resource %s/%s", slug, id)) + + resp.Diagnostics.Append(resp.State.Set(ctx, &remote)...) +} + +func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + component, props, err := utils.Describe("collection-instance") + if err != nil { + resp.Diagnostics.AddError( + "Parse Smallstep OpenAPI spec", + err.Error(), + ) + return + } + + collectionWarning := ` +The collection will be created implicitly if it does not exist. +If creating this collection with a smallstep_collection resource in the same config you MUST use depends_on to avoid race conditions.` + + resp.Schema = schema.Schema{ + MarkdownDescription: component, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + MarkdownDescription: props["id"], + Required: true, + }, + "collection_slug": schema.StringAttribute{ + MarkdownDescription: props["collectionSlug"] + collectionWarning, + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "data": schema.StringAttribute{ + MarkdownDescription: props["data"], + Required: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.RequiresReplace(), + }, + }, + "created_at": schema.StringAttribute{ + MarkdownDescription: props["createdAt"], + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "updated_at": schema.StringAttribute{ + MarkdownDescription: props["updatedAt"], + Computed: true, + }, + }, + } +} + +func (a *Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan Model + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + + if resp.Diagnostics.HasError() { + return + } + + reqBody, diags := toAPI(&plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + b, _ := json.Marshal(reqBody) + tflog.Trace(ctx, string(b)) + + id := plan.ID.ValueString() + slug := plan.CollectionSlug.ValueString() + + httpResp, err := a.client.PutCollectionInstance(ctx, slug, id, &v20230301.PutCollectionInstanceParams{}, *reqBody) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to create collection instance %s/%s: %v", slug, id, err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusOK { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d: %s", httpResp.StatusCode, utils.APIErrorMsg(httpResp.Body)), + ) + return + } + + instance := &v20230301.CollectionInstance{} + if err := json.NewDecoder(httpResp.Body).Decode(instance); err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to unmarshal collection instance %s/%s: %v", slug, id, err), + ) + return + } + + state, diags := fromAPI(ctx, slug, instance, req.Plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Trace(ctx, fmt.Sprintf("create collection instance %s/%s resource", slug, id)) + + resp.Diagnostics.Append(resp.State.Set(ctx, state)...) +} + +func (r *Resource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + // Update not supported. All changes require replacement. +} + +func (a *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state Model + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + + if resp.Diagnostics.HasError() { + return + } + + slug := state.CollectionSlug.ValueString() + id := state.ID.ValueString() + + httpResp, err := a.client.DeleteCollectionInstance(ctx, slug, id, &v20230301.DeleteCollectionInstanceParams{}) + if err != nil { + resp.Diagnostics.AddError( + "Smallstep API Client Error", + fmt.Sprintf("Failed to delete collection instance %s/%s: %v", slug, id, err), + ) + return + } + defer httpResp.Body.Close() + + if httpResp.StatusCode != http.StatusNoContent { + resp.Diagnostics.AddError( + "Smallstep API Response Error", + fmt.Sprintf("Received status %d deleting collection instance %s/%s: %s", httpResp.StatusCode, slug, id, utils.APIErrorMsg(httpResp.Body)), + ) + return + } +} + +func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + parts := strings.Split(req.ID, "/") + if len(parts) != 2 { + resp.Diagnostics.AddError( + "Invalid import ID", + `Import ID must be "<collection_slug>/<id>"`, + ) + return + } + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("collection_slug"), parts[0])...) + resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("id"), parts[1])...) +} diff --git a/internal/provider/collection_resource_test.go b/internal/provider/collection_resource_test.go new file mode 100644 index 0000000..ff90eff --- /dev/null +++ b/internal/provider/collection_resource_test.go @@ -0,0 +1,111 @@ +package provider + +import ( + "context" + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "os" + "regexp" + "strings" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +func init() { + resource.AddTestSweepers("smallstep_collection", &resource.Sweeper{ + Name: "smallstep_collection", + F: func(region string) error { + ctx := context.Background() + + client, err := utils.SmallstepAPIClientFromEnv() + if err != nil { + return err + } + + resp, err := client.ListCollections(ctx, &v20230301.ListCollectionsParams{}) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + return fmt.Errorf("failed to list collections: %d: %s", resp.StatusCode, body) + } + var list []*v20230301.Collection + if err := json.NewDecoder(resp.Body).Decode(&list); err != nil { + return err + } + + for _, collection := range list { + if !strings.HasPrefix(collection.Slug, "tfprovider") { + continue + } + // Don't delete collections that may be used by running tests + age := time.Minute + if sweepAge := os.Getenv("SWEEP_AGE"); sweepAge != "" { + d, err := time.ParseDuration(sweepAge) + if err != nil { + return err + } + age = d + } + if collection.CreatedAt.After(time.Now().Add(age * -1)) { + continue + } + resp, err := client.DeleteCollection(ctx, collection.Slug, &v20230301.DeleteCollectionParams{}) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusNoContent { + body, _ := io.ReadAll(resp.Body) + return fmt.Errorf("failed to delete collection %q: %d: %s", collection.Slug, resp.StatusCode, body) + } + log.Printf("Successfully swept collection %s\n", collection.Slug) + } + + return nil + }, + }) +} + +func TestAccCollectionResource(t *testing.T) { + t.Parallel() + + slug := utils.Slug(t) + config := fmt.Sprintf(` +resource "smallstep_collection" "employees" { + slug = %q + display_name = "Current Employees" +}`, slug) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("smallstep_collection.employees", "slug", slug), + resource.TestCheckResourceAttr("smallstep_collection.employees", "display_name", "Current Employees"), + resource.TestCheckResourceAttr("smallstep_collection.employees", "instance_count", "0"), + resource.TestMatchResourceAttr("smallstep_collection.employees", "created_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + resource.TestMatchResourceAttr("smallstep_collection.employees", "updated_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + ), + }, + { + ResourceName: "smallstep_collection.employees", + ImportState: true, + ImportStateId: slug, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/internal/provider/instance_data_source_test.go b/internal/provider/instance_data_source_test.go new file mode 100644 index 0000000..8db4bd9 --- /dev/null +++ b/internal/provider/instance_data_source_test.go @@ -0,0 +1,43 @@ +package provider + +import ( + "encoding/json" + "fmt" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" + "github.com/stretchr/testify/require" +) + +func TestAccCollectionInstanceDataSource(t *testing.T) { + t.Parallel() + collection := utils.NewCollection(t) + instance := utils.NewCollectionInstance(t, collection.Slug) + config := fmt.Sprintf(` +data "smallstep_collection_instance" "test" { + collection_slug = %q + id = %q +} +`, collection.Slug, instance.Id) + + dataJSON, err := json.Marshal(instance.Data) + require.NoError(t, err) + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("data.smallstep_collection_instance.test", "collection_slug", collection.Slug), + resource.TestCheckResourceAttr("data.smallstep_collection_instance.test", "id", instance.Id), + resource.TestCheckResourceAttr("data.smallstep_collection_instance.test", "data", string(dataJSON)), + resource.TestMatchResourceAttr("data.smallstep_collection_instance.test", "created_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + resource.TestMatchResourceAttr("data.smallstep_collection_instance.test", "updated_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + ), + }, + }, + }) +} diff --git a/internal/provider/instance_resource_test.go b/internal/provider/instance_resource_test.go new file mode 100644 index 0000000..1292c4f --- /dev/null +++ b/internal/provider/instance_resource_test.go @@ -0,0 +1,73 @@ +package provider + +import ( + "fmt" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/utils" +) + +func TestAccCollectionInstanceResource(t *testing.T) { + t.Parallel() + + slug := utils.Slug(t) + config := fmt.Sprintf(` +resource "smallstep_collection" "things" { + slug = %q +} + +resource "smallstep_collection_instance" "thing1" { + collection_slug = %q + id = "thing1" + data = "{\"name\":\"thing1\"}" + depends_on = [smallstep_collection.things] +}`, slug, slug) + + updated := fmt.Sprintf(` +resource "smallstep_collection" "things" { + slug = %q +} + +resource "smallstep_collection_instance" "thing1" { + collection_slug = %q + id = "thing1" + data = "{\"name\":\"thing2\"}" + depends_on = [smallstep_collection.things] +}`, slug, slug) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: config, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("smallstep_collection_instance.thing1", "collection_slug", slug), + resource.TestCheckResourceAttr("smallstep_collection_instance.thing1", "data", `{"name":"thing1"}`), + resource.TestMatchResourceAttr("smallstep_collection_instance.thing1", "created_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + resource.TestMatchResourceAttr("smallstep_collection_instance.thing1", "updated_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + ), + }, + { + Config: updated, + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("smallstep_collection_instance.thing1", "collection_slug", slug), + resource.TestCheckResourceAttr("smallstep_collection_instance.thing1", "data", `{"name":"thing2"}`), + resource.TestMatchResourceAttr("smallstep_collection_instance.thing1", "created_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + resource.TestMatchResourceAttr("smallstep_collection_instance.thing1", "updated_at", regexp.MustCompile(`^20\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ`)), + ), + }, + { + ResourceName: "smallstep_collection_instance.thing1", + ImportState: true, + ImportStateId: fmt.Sprintf("%s/thing1", slug), + // This only succeeds because the data JSON is simple enough to + // have the same serialization every time. Change to `false` to + // test more complex JSON. + ImportStateVerify: true, + }, + }, + }) +} diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 5b6be8b..1fc5af1 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -14,6 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" "github.com/smallstep/terraform-provider-smallstep/internal/provider/authority" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/collection" + "github.com/smallstep/terraform-provider-smallstep/internal/provider/collection_instance" "github.com/smallstep/terraform-provider-smallstep/internal/provider/provisioner" ) @@ -164,6 +166,8 @@ func (p *SmallstepProvider) Resources(ctx context.Context) []func() resource.Res return []func() resource.Resource{ authority.NewResource, provisioner.NewResource, + collection.NewResource, + collection_instance.NewResource, } } @@ -171,6 +175,8 @@ func (p *SmallstepProvider) DataSources(ctx context.Context) []func() datasource return []func() datasource.DataSource{ authority.NewDataSource, provisioner.NewDataSource, + collection.NewDataSource, + collection_instance.NewDataSource, } } diff --git a/internal/provider/provisioner/model.go b/internal/provider/provisioner/model.go index 774e022..cf2532d 100644 --- a/internal/provider/provisioner/model.go +++ b/internal/provider/provisioner/model.go @@ -345,7 +345,8 @@ func fromAPI(ctx context.Context, provisioner *v20230301.Provisioner, authorityI } } - if provisioner.Options != nil { + // Not including webhooks here + if provisioner.Options != nil && (provisioner.Options.Ssh != nil || provisioner.Options.X509 != nil) { data.Options = &OptionsModel{} if provisioner.Options.X509 != nil { diff --git a/internal/provider/provisioner/resource.go b/internal/provider/provisioner/resource.go index 9e909fd..6e9f68a 100644 --- a/internal/provider/provisioner/resource.go +++ b/internal/provider/provisioner/resource.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "net/http" - "reflect" "strings" "time" @@ -567,7 +566,7 @@ func (a *Resource) Create(ctx context.Context, req resource.CreateRequest, resp // Use the original key if it's a jwk provisioner. Terraform will fail if // the state does not match the plan but there are many valid json // serializations of the key - if plan.JWK != nil && state.JWK != nil && jsonEqual(plan.JWK.Key.ValueString(), state.JWK.Key.ValueString()) { + if plan.JWK != nil && state.JWK != nil && utils.IsJSONEqual(plan.JWK.Key.ValueString(), state.JWK.Key.ValueString()) { state.JWK.Key = plan.JWK.Key } // A null claims is returned as an empty claims object. Restore it to null @@ -612,6 +611,11 @@ func (a *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *res return } + if httpResp.StatusCode == http.StatusNotFound { + resp.State.RemoveResource(ctx) + return + } + if httpResp.StatusCode != http.StatusOK { resp.Diagnostics.AddError( "Smallstep API Response Error", @@ -637,7 +641,7 @@ func (a *Resource) Read(ctx context.Context, req resource.ReadRequest, resp *res // Use the original key if it's a jwk provisioner. Terraform will fail if // the stored state does not match the current state but there are many valid // json serializations of the key. - if state.JWK != nil && actual.JWK != nil && jsonEqual(state.JWK.Key.ValueString(), actual.JWK.Key.ValueString()) { + if state.JWK != nil && actual.JWK != nil && utils.IsJSONEqual(state.JWK.Key.ValueString(), actual.JWK.Key.ValueString()) { actual.JWK.Key = state.JWK.Key } @@ -691,7 +695,6 @@ func (a *Resource) Delete(ctx context.Context, req resource.DeleteRequest, resp } func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) parts := strings.Split(req.ID, "/") if len(parts) != 2 { resp.Diagnostics.AddError( @@ -712,20 +715,6 @@ func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequ resp.Diagnostics.Append(resp.State.SetAttribute(ctx, path.Root("name"), parts[1])...) } -func jsonEqual(a, b string) bool { - if a == b { - return true - } - var aVal, bVal any - if err := json.Unmarshal([]byte(a), &aVal); err != nil { - return false - } - if err := json.Unmarshal([]byte(b), &bVal); err != nil { - return false - } - return reflect.DeepEqual(aVal, bVal) -} - func durationEqual(a, b types.String) bool { if a.IsNull() || b.IsNull() { return false diff --git a/internal/provider/utils/equal.go b/internal/provider/utils/equal.go new file mode 100644 index 0000000..efed101 --- /dev/null +++ b/internal/provider/utils/equal.go @@ -0,0 +1,69 @@ +package utils + +import ( + "context" + "encoding/json" + "reflect" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +type IsStringEqual func(string, string) bool + +// ToEqualString checks if a remote string is equivalent to a string in state +// and if so uses the string from state. This is used to avoid "inconsistent +// result after apply" errors for JSON and duration strings. +func ToEqualString(ctx context.Context, remote *string, state AttributeGetter, p path.Path, isEqual IsStringEqual) (types.String, diag.Diagnostics) { + stringFromState := types.String{} + diags := state.GetAttribute(ctx, p, &stringFromState) + if diags.HasError() { + return types.String{}, diags + } + + stateIsEmpty := stringFromState.IsNull() || stringFromState.ValueString() == "" + remoteIsEmpty := remote == nil || *remote == "" + + switch { + case remoteIsEmpty && stateIsEmpty: + return stringFromState, diags + case remote == nil: + return types.StringNull(), diags + case isEqual(*remote, stringFromState.ValueString()): + return stringFromState, diags + default: + return types.StringValue(*remote), diags + } +} + +func IsJSONEqual(a, b string) bool { + if a == b { + return true + } + var aVal, bVal any + if err := json.Unmarshal([]byte(a), &aVal); err != nil { + return false + } + if err := json.Unmarshal([]byte(b), &bVal); err != nil { + return false + } + return reflect.DeepEqual(aVal, bVal) +} + +func IsDurationEqual(a, b string) bool { + if a == b { + return true + } + aDuration, err := time.ParseDuration(a) + if err != nil { + return false + } + bDuration, err := time.ParseDuration(b) + if err != nil { + return false + } + + return aDuration == bDuration +} diff --git a/internal/provider/utils/optional.go b/internal/provider/utils/optional.go index cb6596f..afc517e 100644 --- a/internal/provider/utils/optional.go +++ b/internal/provider/utils/optional.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" + v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" ) // These helpers handle conversion from API types to terraform types for @@ -39,7 +40,36 @@ func ToOptionalSet(ctx context.Context, remote *[]string, priorState AttributeGe return types.SetValue(types.StringType, values) } -func ToOptionalString(ctx context.Context, remote *string, priorState AttributeGetter, p path.Path) (types.String, diag.Diagnostics) { +func ToOptionalList(ctx context.Context, remote *[]string, priorState AttributeGetter, p path.Path) (types.List, diag.Diagnostics) { + if remote == nil || len(*remote) == 0 { + listFromState := types.List{} + diags := priorState.GetAttribute(ctx, p, &listFromState) + if diags.HasError() { + return types.List{}, diags + } + if listFromState.IsNull() || len(listFromState.Elements()) == 0 { + return listFromState, diags + } + } + + if remote == nil { + return types.ListNull(types.StringType), diag.Diagnostics{} + } + + values := make([]attr.Value, len(*remote)) + for i, s := range *remote { + values[i] = types.StringValue(s) + } + return types.ListValue(types.StringType, values) +} + +type Str interface { + string | + v20230301.EndpointKeyInfoFormat | + v20230301.EndpointKeyInfoType +} + +func ToOptionalString[S Str](ctx context.Context, remote *S, priorState AttributeGetter, p path.Path) (types.String, diag.Diagnostics) { if remote == nil || *remote == "" { stringFromState := types.String{} diags := priorState.GetAttribute(ctx, p, &stringFromState) @@ -55,7 +85,7 @@ func ToOptionalString(ctx context.Context, remote *string, priorState AttributeG return types.StringNull(), diag.Diagnostics{} } - return types.StringValue(*remote), diag.Diagnostics{} + return types.StringValue(string(*remote)), diag.Diagnostics{} } func ToOptionalBool(ctx context.Context, remote *bool, priorState AttributeGetter, p path.Path) (types.Bool, diag.Diagnostics) { @@ -76,3 +106,22 @@ func ToOptionalBool(ctx context.Context, remote *bool, priorState AttributeGette return types.BoolValue(*remote), diag.Diagnostics{} } + +func ToOptionalInt(ctx context.Context, remote *int, priorState AttributeGetter, p path.Path) (types.Int64, diag.Diagnostics) { + if remote == nil || *remote == 0 { + intFromState := types.Int64{} + diags := priorState.GetAttribute(ctx, p, &intFromState) + if diags.HasError() { + return types.Int64{}, diags + } + if intFromState.IsNull() || intFromState.ValueInt64() == 0 { + return intFromState, diags + } + } + + if remote == nil { + return types.Int64Null(), diag.Diagnostics{} + } + + return types.Int64Value(int64(*remote)), diag.Diagnostics{} +} diff --git a/internal/provider/utils/testutils.go b/internal/provider/utils/testutils.go index c0fd211..5b5df5d 100644 --- a/internal/provider/utils/testutils.go +++ b/internal/provider/utils/testutils.go @@ -7,16 +7,20 @@ import ( "errors" "fmt" "io" + "log" "net/http" "os" + "strings" "testing" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-testing/helper/acctest" v20230301 "github.com/smallstep/terraform-provider-smallstep/internal/apiclient/v20230301" "github.com/stretchr/testify/require" "go.step.sm/crypto/jose" "go.step.sm/crypto/minica" "go.step.sm/crypto/pemutil" + "go.step.sm/crypto/randutil" ) func SmallstepAPIClientFromEnv() (*v20230301.Client, error) { @@ -131,3 +135,318 @@ func CACerts(t *testing.T) (string, string) { return string(pem.EncodeToMemory(root)), string(pem.EncodeToMemory(intermediate)) } + +func NewWebhook(t *testing.T, provisionerID, authorityID string) *v20230301.ProvisionerWebhook { + client, err := SmallstepAPIClientFromEnv() + if err != nil { + t.Fatal(err) + } + url := "https://example.com/hook" + name, err := randutil.Alphanumeric(8) + require.NoError(t, err) + + req := v20230301.ProvisionerWebhook{ + Name: name, + Url: &url, + Kind: "ENRICHING", + CertType: "ALL", + ServerType: "EXTERNAL", + } + + resp, err := client.PostWebhooks(context.Background(), authorityID, provisionerID, &v20230301.PostWebhooksParams{}, req) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + + require.Equal(t, http.StatusCreated, resp.StatusCode, "got %d: %s", resp.StatusCode, body) + + wh := &v20230301.ProvisionerWebhook{} + require.NoError(t, json.Unmarshal(body, wh)) + wh.Secret = nil + + return wh +} + +func NewCollection(t *testing.T) *v20230301.Collection { + client, err := SmallstepAPIClientFromEnv() + require.NoError(t, err) + + slug := Slug(t) + displayName := "Collection " + slug + + req := v20230301.NewCollection{ + Slug: slug, + DisplayName: &displayName, + } + + resp, err := client.PostCollections(context.Background(), &v20230301.PostCollectionsParams{}, req) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + + require.Equal(t, http.StatusCreated, resp.StatusCode, "got %d: %s", resp.StatusCode, body) + + collection := &v20230301.Collection{} + err = json.Unmarshal(body, collection) + require.NoError(t, err) + + return collection +} + +func NewCollectionInstance(t *testing.T, slug string) *v20230301.CollectionInstance { + client, err := SmallstepAPIClientFromEnv() + require.NoError(t, err) + + id, err := randutil.Alphanumeric(8) + require.NoError(t, err) + + req := v20230301.PutCollectionInstanceJSONRequestBody{ + Data: map[string]string{"id": id}, + } + resp, err := client.PutCollectionInstance(context.Background(), slug, id, &v20230301.PutCollectionInstanceParams{}, req) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + + require.Equal(t, http.StatusOK, resp.StatusCode, "got %d: %s", resp.StatusCode, body) + + instance := &v20230301.CollectionInstance{} + err = json.Unmarshal(body, instance) + require.NoError(t, err) + + return instance +} + +func Slug(t *testing.T) string { + slug, err := randutil.String(10, "abcdefghijklmnopqrstuvwxyz0123456789") + require.NoError(t, err) + return "tfprovider" + slug +} + +// There can only be 1 per team - don't try to create a new one if one exists +func FixAttestationAuthority(t *testing.T, catalog string) *v20230301.AttestationAuthority { + client, err := SmallstepAPIClientFromEnv() + require.NoError(t, err) + + resp, err := client.GetAttestationAuthorities(context.Background(), &v20230301.GetAttestationAuthoritiesParams{}) + require.NoError(t, err) + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + + require.Equal(t, http.StatusOK, resp.StatusCode, "list attestation authorities got %d: %s", resp.StatusCode, body) + + list := []*v20230301.AttestationAuthority{} + err = json.Unmarshal(body, &list) + require.NoError(t, err) + + if len(list) > 0 { + return list[0] + } + + root, intermediate := CACerts(t) + + req := v20230301.AttestationAuthority{ + Name: "tfprovider", + AttestorRoots: root, + AttestorIntermediates: &intermediate, + Catalog: catalog, + } + + resp, err = client.PostAttestationAuthorities(context.Background(), &v20230301.PostAttestationAuthoritiesParams{}, req) + require.NoError(t, err) + body, err = io.ReadAll(resp.Body) + require.NoError(t, err) + + require.Equal(t, http.StatusCreated, resp.StatusCode, "create attestation authority got %d: %s", resp.StatusCode, body) + + aa := &v20230301.AttestationAuthority{} + err = json.Unmarshal(body, aa) + require.NoError(t, err) + + return aa +} + +func SweepAttestationAuthorities() error { + client, err := SmallstepAPIClientFromEnv() + if err != nil { + return err + } + + resp, err := client.GetAttestationAuthorities(context.Background(), &v20230301.GetAttestationAuthoritiesParams{}) + if err != nil { + return err + } + body, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("list attestation authorities got %d: %s", resp.StatusCode, body) + } + + list := []*v20230301.AttestationAuthority{} + if err := json.Unmarshal(body, &list); err != nil { + return err + } + + for _, aa := range list { + if !strings.HasPrefix(aa.Name, "tfprovider") { + continue + } + resp, err := client.DeleteAttestationAuthority(context.Background(), *aa.Id, &v20230301.DeleteAttestationAuthorityParams{}) + if err != nil { + return err + } + defer resp.Body.Close() + body, _ := io.ReadAll(resp.Body) + + if resp.StatusCode != http.StatusNoContent { + return fmt.Errorf("delete attestation authority %q got %d: %s", *aa.Id, resp.StatusCode, body) + } + log.Printf("Successfully swept attestation authority %s\n", *aa.Id) + } + + return nil +} + +func NewAgentConfiguration(t *testing.T, authorityID, provisionerName, attestSlug string) *v20230301.AgentConfiguration { + client, err := SmallstepAPIClientFromEnv() + require.NoError(t, err) + + slug := Slug(t) + reqBody := v20230301.AgentConfiguration{ + Name: "tfprovider" + slug, + AttestationSlug: &attestSlug, + AuthorityID: authorityID, + Provisioner: provisionerName, + } + + resp, err := client.PostAgentConfigurations(context.Background(), &v20230301.PostAgentConfigurationsParams{}, reqBody) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, 201, resp.StatusCode, fmt.Sprintf("POST /agent-configurations: %d %s", resp.StatusCode, body)) + + ac := &v20230301.AgentConfiguration{} + require.NoError(t, json.Unmarshal(body, ac)) + + return ac +} + +func NewManagedConfiguration(t *testing.T, agentConfigID string, endpointConfigID string) *v20230301.ManagedConfiguration { + client, err := SmallstepAPIClientFromEnv() + require.NoError(t, err) + + hostID := uuid.New().String() + slug := Slug(t) + + reqBody := v20230301.ManagedConfiguration{ + AgentConfigurationID: agentConfigID, + HostID: &hostID, + Name: "tfprovider" + slug, + ManagedEndpoints: []v20230301.ManagedEndpoint{ + { + EndpointConfigurationID: endpointConfigID, + X509CertificateData: &v20230301.EndpointX509CertificateData{ + CommonName: "db1", + Sans: []string{"db.internal"}, + }, + }, + }, + } + resp, err := client.PostManagedConfigurations(context.Background(), &v20230301.PostManagedConfigurationsParams{}, reqBody) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, 201, resp.StatusCode, fmt.Sprintf("POST /managed-configuraions %d: %s", resp.StatusCode, body)) + + mc := &v20230301.ManagedConfiguration{} + require.NoError(t, json.Unmarshal(body, mc)) + + return mc +} + +func NewEndpointConfiguration(t *testing.T, authorityID, provisionerName string) *v20230301.EndpointConfiguration { + client, err := SmallstepAPIClientFromEnv() + require.NoError(t, err) + + uid, gid, mode := 1000, 999, 0400 + pubFile := "pub.crt" + pidFile := "db.pid" + signal := 15 + signShell := "/bin/sh" + renewShell := "/bin/bash" + beforeSign := []string{"echo sign"} + afterSign := []string{"echo signed"} + failSign := []string{"echo failed to sign"} + beforeRenew := []string{"echo renew"} + afterRenew := []string{"echo renewed"} + failRenew := []string{"echo failed to renew"} + crtFile := "db.crt" + keyFile := "db.key" + rootFile := "ca.crt" + duration := "5m0s" + keyType := v20230301.EndpointKeyInfoTypeDEFAULT + keyFormat := v20230301.EndpointKeyInfoFormatDEFAULT + slug := Slug(t) + + req := v20230301.EndpointConfiguration{ + Name: "tfprovider" + slug, + Kind: v20230301.DEVICE, + AuthorityID: authorityID, + Provisioner: provisionerName, + CertificateInfo: v20230301.EndpointCertificateInfo{ + Type: v20230301.EndpointCertificateInfoTypeX509, + CrtFile: &crtFile, + KeyFile: &keyFile, + RootFile: &rootFile, + Duration: &duration, + Uid: &uid, + Gid: &gid, + Mode: &mode, + }, + KeyInfo: &v20230301.EndpointKeyInfo{ + Format: &keyFormat, + Type: &keyType, + PubFile: &pubFile, + }, + ReloadInfo: &v20230301.EndpointReloadInfo{ + Method: v20230301.SIGNAL, + PidFile: &pidFile, + Signal: &signal, + }, + Hooks: &v20230301.EndpointHooks{ + Sign: &v20230301.EndpointHook{ + Shell: &signShell, + After: &afterSign, + Before: &beforeSign, + OnError: &failSign, + }, + Renew: &v20230301.EndpointHook{ + Shell: &renewShell, + After: &afterRenew, + Before: &beforeRenew, + OnError: &failRenew, + }, + }, + } + + params := &v20230301.PostEndpointConfigurationsParams{} + resp, err := client.PostEndpointConfigurations(context.Background(), params, req) + require.NoError(t, err) + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, 201, resp.StatusCode, fmt.Sprintf("POST /endpoint-configurations %d: %s", resp.StatusCode, body)) + + ec := &v20230301.EndpointConfiguration{} + require.NoError(t, json.Unmarshal(body, ec)) + + return ec +} diff --git a/internal/provider/utils/utils.go b/internal/provider/utils/utils.go index b4c48f5..56f7d00 100644 --- a/internal/provider/utils/utils.go +++ b/internal/provider/utils/utils.go @@ -27,7 +27,9 @@ type dereferencable interface { string | bool | int | - []string + []string | + v20230301.EndpointKeyInfoType | + v20230301.EndpointKeyInfoFormat } // Deref gets the default value for a pointer type. This makes it easier to work @@ -39,6 +41,22 @@ func Deref[T dereferencable](v *T) (r T) { return } +func ToIntPointer(i64 *int64) *int { + if i64 == nil { + return nil + } + i := int(*i64) + return &i +} + +func ToStringPointer[In Str, Out Str](str *In) *Out { + if str == nil { + return nil + } + s := Out(*str) + return &s +} + // Describe parses descriptions for a component from its schema in Smallstep's // OpenAPI spec. This ensures the terraform attribute documentation is kept in // sync with the API spec. -- GitLab